home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1993-11-07 | 87.8 KB | [ ONLN/HLX2]
open in: MacOS 8.1
extracted
|
Win98
extracted
|
DOS
extracted
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary ).
Confidence Program Detection Match Type Support
10%
dexvert
MacBinary (archive/macBinary)
fallback
Supported
100%
file
MacBinary II, inited, Sun Nov 7 04:12:47 1993, modified Sun Nov 7 04:12:49 1993, creator 'HLX2', type 'ONLN', 86955 bytes "Using Audit" , at 0x1542b 2600 bytes resource
default (weak)
99%
file
data
default
100%
TrID
MacBinary 2
default (weak)
100%
siegfried
fmt/1762 MacBinary (II)
default
100%
lsar
MacBinary
default
id metadata key value macFileType [ ONLN] macFileCreator [ HLX2]
hex view +--------+-------------------------+-------------------------+--------+--------+ |00000000| 00 0b 55 73 69 6e 67 20 | 41 75 64 69 74 00 00 00 |..Using |Audit...| |00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00000040| 00 4f 4e 4c 4e 48 4c 58 | 32 01 00 00 00 00 00 00 |.ONLNHLX|2.......| |00000050| 00 00 00 00 01 53 ab 00 | 00 0a 28 a9 02 6c 8f a9 |.....S..|..(..l..| |00000060| 02 6c 91 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.l......|........| |00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 80 f3 00 00 |........|........| |00000080| 54 68 65 20 41 75 64 69 | 74 20 4c 69 62 72 61 72 |The Audi|t Librar| |00000090| 79 0d 4d 61 72 74 69 6e | 20 4d 69 6e 6f 77 0d 44 |y.Martin| Minow.D| |000000a0| 65 76 65 6c 6f 70 65 72 | 20 54 65 63 68 6e 69 63 |eveloper| Technic| |000000b0| 61 6c 20 53 75 70 70 6f | 72 74 0d 49 6e 74 72 6f |al Suppo|rt.Intro| |000000c0| 64 75 63 74 69 6f 6e 0d | 54 68 65 20 41 75 64 69 |duction.|The Audi| |000000d0| 74 20 4c 69 62 72 61 72 | 79 20 61 6c 6c 6f 77 73 |t Librar|y allows| |000000e0| 20 79 6f 75 20 74 6f 20 | 61 64 64 20 65 76 65 6e | you to |add even| |000000f0| 74 20 74 72 61 63 69 6e | 67 20 74 6f 20 61 6c 6c |t tracin|g to all| |00000100| 20 74 79 70 65 73 20 6f | 66 20 4d 61 63 69 6e 74 | types o|f Macint| |00000110| 6f 73 68 20 63 6f 64 65 | 20 73 65 67 6d 65 6e 74 |osh code| segment| |00000120| 73 2c 20 69 6e 63 6c 75 | 64 69 6e 67 20 64 65 76 |s, inclu|ding dev| |00000130| 69 63 65 20 64 72 69 76 | 65 72 73 2c 20 63 61 6c |ice driv|ers, cal| |00000140| 6c 62 61 63 6b 20 72 6f | 75 74 69 6e 65 73 2c 20 |lback ro|utines, | |00000150| 64 79 6e 61 6d 69 63 61 | 6c 6c 79 2d 6c 6f 61 64 |dynamica|lly-load| |00000160| 65 64 20 63 6f 64 65 20 | 73 65 67 6d 65 6e 74 73 |ed code |segments| |00000170| 2c 20 61 6e 64 20 61 70 | 70 6c 69 63 61 74 69 6f |, and ap|plicatio| |00000180| 6e 73 2e 20 45 78 63 65 | 70 74 20 66 6f 72 20 74 |ns. Exce|pt for t| |00000190| 68 65 20 69 6e 69 74 69 | 61 6c 69 7a 61 74 69 6f |he initi|alizatio| |000001a0| 6e 20 72 6f 75 74 69 6e | 65 2c 20 61 6c 6c 20 66 |n routin|e, all f| |000001b0| 75 6e 63 74 69 6f 6e 73 | 20 6d 61 79 20 62 65 20 |unctions| may be | |000001c0| 63 61 6c 6c 65 64 20 61 | 74 20 61 6e 79 20 74 69 |called a|t any ti| |000001d0| 6d 65 2c 20 65 76 65 6e | 20 77 69 74 68 69 6e 20 |me, even| within | |000001e0| 69 6e 74 65 72 72 75 70 | 74 20 6f 72 20 49 2f 4f |interrup|t or I/O| |000001f0| 20 63 6f 6d 70 6c 65 74 | 69 6f 6e 20 72 6f 75 74 | complet|ion rout| |00000200| 69 6e 65 73 2e 20 54 68 | 65 20 6c 69 62 72 61 72 |ines. Th|e librar| |00000210| 79 20 69 73 20 64 65 73 | 69 67 6e 65 64 20 74 6f |y is des|igned to| |00000220| 20 62 65 20 d2 66 61 69 | 6c 2d 73 61 66 65 3a d3 | be .fai|l-safe:.| |00000230| 20 69 74 20 68 61 73 20 | 6e 6f 20 65 72 72 6f 72 | it has |no error| |00000240| 20 63 6f 6e 64 69 74 69 | 6f 6e 73 20 61 6e 64 2c | conditi|ons and,| |00000250| 20 62 61 72 72 69 6e 67 | 20 61 20 6d 61 6c 69 63 | barring| a malic| |00000260| 69 6f 75 73 20 61 74 74 | 61 63 6b 2c 20 77 69 6c |ious att|ack, wil| |00000270| 6c 20 65 69 74 68 65 72 | 20 64 6f 20 77 68 61 74 |l either| do what| |00000280| 20 69 73 20 72 65 71 75 | 65 73 74 65 64 20 6f 72 | is requ|ested or| |00000290| 20 64 6f 20 6e 6f 74 68 | 69 6e 67 2c 20 62 75 74 | do noth|ing, but| |000002a0| 20 69 74 20 73 68 6f 75 | 6c 64 20 6e 65 76 65 72 | it shou|ld never| |000002b0| 20 63 72 61 73 68 20 6f | 72 20 73 74 61 6c 6c 20 | crash o|r stall | |000002c0| 79 6f 75 72 20 70 72 6f | 67 72 61 6d 2e 20 49 6e |your pro|gram. In| |000002d0| 20 70 61 72 74 69 63 75 | 6c 61 72 2c 20 69 66 20 | particu|lar, if | |000002e0| 79 6f 75 72 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |your app|lication| |000002f0| 20 74 72 69 65 73 20 74 | 6f 20 6c 6f 67 20 64 61 | tries t|o log da| |00000300| 74 61 20 77 68 65 6e 20 | 6e 6f 20 61 75 64 69 74 |ta when |no audit| |00000310| 20 72 65 63 6f 72 64 20 | 68 61 73 20 62 65 65 6e | record |has been| |00000320| 20 65 73 74 61 62 6c 69 | 73 68 65 64 2c 20 6f 72 | establi|shed, or| |00000330| 20 74 68 65 72 65 20 69 | 73 20 6e 6f 20 72 6f 6f | there i|s no roo| |00000340| 6d 20 69 6e 20 74 68 65 | 20 61 75 64 69 74 20 72 |m in the| audit r| |00000350| 65 63 6f 72 64 2c 20 79 | 6f 75 72 20 70 72 6f 67 |ecord, y|our prog| |00000360| 72 61 6d 20 77 69 6c 6c | 20 6e 6f 74 20 73 74 61 |ram will| not sta| |00000370| 6c 6c 2c 20 63 72 61 73 | 68 20 6f 72 20 64 61 6d |ll, cras|h or dam| |00000380| 61 67 65 20 74 68 65 20 | 73 79 73 74 65 6d 2e 0d |age the |system..| |00000390| 55 53 41 47 45 0d 54 6f | 20 75 73 65 20 74 68 65 |USAGE.To| use the| |000003a0| 20 41 75 64 69 74 20 6c | 69 62 72 61 72 79 2c 20 | Audit l|ibrary, | |000003b0| 79 6f 75 20 6d 75 73 74 | 20 69 6e 63 6c 75 64 65 |you must| include| |000003c0| 20 69 74 73 20 64 65 66 | 69 6e 69 74 69 6f 6e 20 | its def|inition | |000003d0| 66 69 6c 65 2c 20 63 72 | 65 61 74 65 20 61 6e 20 |file, cr|eate an | |000003e0| 41 75 64 69 74 20 72 65 | 63 6f 72 64 2c 20 73 74 |Audit re|cord, st| |000003f0| 6f 72 65 20 64 61 74 61 | 2c 20 61 6e 64 20 72 65 |ore data|, and re| |00000400| 61 64 20 64 61 74 61 2e | 20 54 68 65 20 66 6f 6c |ad data.| The fol| |00000410| 6c 6f 77 69 6e 67 20 65 | 78 61 6d 70 6c 65 73 20 |lowing e|xamples | |00000420| 73 68 6f 77 20 74 68 69 | 73 20 69 6e 20 74 68 65 |show thi|s in the| |00000430| 20 63 6f 6e 74 65 78 74 | 20 6f 66 20 61 20 73 69 | context| of a si| |00000440| 6e 67 6c 65 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |ngle app|lication| |00000450| 3b 20 68 6f 77 65 76 65 | 72 20 72 65 61 6c 2d 77 |; howeve|r real-w| |00000460| 6f 72 6c 64 20 75 73 65 | 72 73 20 77 6f 75 6c 64 |orld use|rs would| |00000470| 20 70 72 6f 62 61 62 6c | 79 20 73 70 6c 69 74 20 | probabl|y split | |00000480| 74 68 65 20 66 75 6e 63 | 74 69 6f 6e 73 20 61 6d |the func|tions am| |00000490| 6f 6e 67 20 73 65 70 61 | 72 61 74 65 20 61 70 70 |ong sepa|rate app| |000004a0| 6c 69 63 61 74 69 6f 6e | 73 3b 20 70 65 72 68 61 |lication|s; perha| |000004b0| 70 73 20 62 79 20 63 72 | 65 61 74 69 6e 67 20 74 |ps by cr|eating t| |000004c0| 68 65 20 41 75 64 69 74 | 20 72 65 63 6f 72 64 20 |he Audit| record | |000004d0| 69 6e 20 61 6e 20 69 6e | 69 74 20 6f 72 20 64 72 |in an in|it or dr| |000004e0| 69 76 65 72 20 6f 70 65 | 6e 20 72 6f 75 74 69 6e |iver ope|n routin| |000004f0| 65 2c 20 73 74 6f 72 69 | 6e 67 20 64 61 74 61 20 |e, stori|ng data | |00000500| 69 6e 20 61 20 64 72 69 | 76 65 72 20 6f 72 20 63 |in a dri|ver or c| |00000510| 61 6c 6c 62 61 63 6b 20 | 63 6f 64 65 2d 73 65 67 |allback |code-seg| |00000520| 6d 65 6e 74 2c 20 61 6e | 64 20 64 69 73 70 6c 61 |ment, an|d displa| |00000530| 79 69 6e 67 20 64 61 74 | 61 20 69 6e 20 61 20 73 |ying dat|a in a s| |00000540| 74 61 6e 64 2d 61 6c 6f | 6e 65 20 61 70 70 6c 69 |tand-alo|ne appli| |00000550| 63 61 74 69 6f 6e 20 6f | 72 20 4d 61 63 73 42 75 |cation o|r MacsBu| |00000560| 67 20 64 63 6d 64 2e 0d | 47 6c 6f 62 61 6c 20 56 |g dcmd..|Global V| |00000570| 61 72 69 61 62 6c 65 20 | 44 65 66 69 6e 69 74 69 |ariable |Definiti| |00000580| 6f 6e 73 0d 41 20 76 65 | 72 79 20 73 69 6d 70 6c |ons.A ve|ry simpl| |00000590| 65 20 41 75 64 69 74 20 | 64 69 73 70 6c 61 79 20 |e Audit |display | |000005a0| 61 70 70 6c 69 63 61 74 | 69 6f 6e 20 6d 69 67 68 |applicat|ion migh| |000005b0| 74 20 64 65 66 69 6e 65 | 20 74 68 65 20 70 61 72 |t define| the par| |000005c0| 61 6d 65 74 65 72 73 20 | 69 74 20 6e 65 65 64 73 |ameters |it needs| |000005d0| 20 61 73 20 67 6c 6f 62 | 61 6c 20 76 61 6c 75 65 | as glob|al value| |000005e0| 73 3a 0d 23 69 6e 63 6c | 75 64 65 20 22 41 75 64 |s:.#incl|ude "Aud| |000005f0| 69 74 2e 68 22 0d 41 75 | 64 69 74 50 74 72 09 09 |it.h".Au|ditPtr..| |00000600| 09 09 67 41 75 64 69 74 | 50 74 72 3b 09 09 2f 2a |..gAudit|Ptr;../*| |00000610| 20 52 65 74 75 72 6e 65 | 64 20 62 79 20 49 6e 69 | Returne|d by Ini| |00000620| 74 41 75 64 69 74 20 61 | 6e 64 20 52 65 61 64 41 |tAudit a|nd ReadA| |00000630| 75 64 69 74 09 09 2a 2f | 0d 41 75 64 69 74 45 6e |udit..*/|.AuditEn| |00000640| 74 72 79 09 09 09 67 43 | 75 72 72 65 6e 74 45 6e |try...gC|urrentEn| |00000650| 74 72 79 3b 09 2f 2a 20 | 52 65 74 75 72 6e 65 64 |try;./* |Returned| |00000660| 20 62 79 20 52 65 61 64 | 41 75 64 69 74 09 09 09 | by Read|Audit...| |00000670| 09 09 09 2a 2f 0d 50 72 | 6f 63 65 73 73 53 65 72 |...*/.Pr|ocessSer| |00000680| 69 61 6c 4e 75 6d 62 65 | 72 09 67 50 72 6f 63 65 |ialNumbe|r.gProce| |00000690| 73 73 53 65 72 69 61 6c | 4e 75 6d 62 65 72 3b 09 |ssSerial|Number;.| |000006a0| 2f 2a 20 55 73 65 64 20 | 62 79 20 57 61 6b 65 55 |/* Used |by WakeU| |000006b0| 70 41 75 64 69 74 09 09 | 09 09 2a 2f 0d 42 6f 6f |pAudit..|..*/.Boo| |000006c0| 6c 65 61 6e 09 09 09 09 | 67 48 61 73 50 53 4e 3b |lean....|gHasPSN;| |000006d0| 09 09 09 09 09 2f 2a 20 | 53 65 65 20 57 61 6b 65 |...../* |See Wake| |000006e0| 55 70 41 75 64 69 74 20 | 65 78 61 6d 70 6c 65 09 |UpAudit |example.| |000006f0| 09 09 2a 2f 0d 43 72 65 | 61 74 69 6e 67 20 74 68 |..*/.Cre|ating th| |00000700| 65 20 41 75 64 69 74 20 | 52 65 63 6f 72 64 0d 55 |e Audit |Record.U| |00000710| 73 69 6e 67 20 74 68 65 | 20 61 62 6f 76 65 20 64 |sing the| above d| |00000720| 65 66 69 6e 69 74 69 6f | 6e 73 2c 20 74 68 65 20 |efinitio|ns, the | |00000730| 66 6f 6c 6c 6f 77 69 6e | 67 20 73 74 61 74 65 6d |followin|g statem| |00000740| 65 6e 74 73 20 63 72 65 | 61 74 65 20 61 6e 64 20 |ents cre|ate and | |00000750| 69 6e 69 74 69 61 6c 69 | 7a 65 20 61 6e 20 61 75 |initiali|ze an au| |00000760| 64 69 74 20 72 65 63 6f | 72 64 3a 0d 09 09 42 6f |dit reco|rd:...Bo| |00000770| 6f 6c 65 61 6e 20 69 6e | 69 74 69 61 6c 6c 79 45 |olean in|itiallyE| |00000780| 6e 61 62 6c 65 64 20 3d | 20 54 52 55 45 3b 0d 09 |nabled =| TRUE;..| |00000790| 09 42 6f 6f 6c 65 61 6e | 20 70 72 65 73 65 72 76 |.Boolean| preserv| |000007a0| 65 46 69 72 73 74 45 6e | 74 72 69 65 73 20 3d 20 |eFirstEn|tries = | |000007b0| 46 41 4c 53 45 3b 0d 09 | 09 67 41 75 64 69 74 50 |FALSE;..|.gAuditP| |000007c0| 74 72 20 3d 20 49 6e 69 | 74 41 75 64 69 74 28 27 |tr = Ini|tAudit('| |000007d0| 4d 6f 6f 66 27 2c 20 36 | 34 2c 20 69 6e 69 74 69 |Moof', 6|4, initi| |000007e0| 61 6c 6c 79 45 6e 61 62 | 6c 65 64 20 2c 20 70 72 |allyEnab|led , pr| |000007f0| 65 73 65 72 76 65 46 69 | 72 73 74 45 6e 74 72 69 |eserveFi|rstEntri| |00000800| 65 73 29 3b 0d 54 68 65 | 20 61 62 6f 76 65 20 63 |es);.The| above c| |00000810| 61 6c 6c 20 63 72 65 61 | 74 65 73 20 61 6e 20 61 |all crea|tes an a| |00000820| 75 64 69 74 20 72 65 63 | 6f 72 64 20 d2 6e 61 6d |udit rec|ord .nam| |00000830| 65 64 d3 20 4d 6f 6f 66 | 20 74 68 61 74 20 63 61 |ed. Moof| that ca| |00000840| 6e 20 73 74 6f 72 65 20 | 36 34 20 61 75 64 69 74 |n store |64 audit| |00000850| 20 72 65 63 6f 72 64 20 | 65 6e 74 72 69 65 73 2e | record |entries.| |00000860| 20 41 75 64 69 74 69 6e | 67 20 69 73 20 69 6e 69 | Auditin|g is ini| |00000870| 74 69 61 6c 6c 79 20 65 | 6e 61 62 6c 65 64 2e 20 |tially e|nabled. | |00000880| 49 66 20 74 68 65 72 65 | 20 69 73 20 6e 6f 20 72 |If there| is no r| |00000890| 6f 6f 6d 20 69 6e 20 74 | 68 65 20 61 75 64 69 74 |oom in t|he audit| |000008a0| 20 72 65 63 6f 72 64 2c | 20 74 68 65 20 66 69 72 | record,| the fir| |000008b0| 73 74 20 65 6e 74 72 79 | 20 77 61 69 74 69 6e 67 |st entry| waiting| |000008c0| 20 66 6f 72 20 74 68 65 | 20 64 69 73 70 6c 61 79 | for the| display| |000008d0| 20 72 6f 75 74 69 6e 65 | 20 77 69 6c 6c 20 62 65 | routine| will be| |000008e0| 20 75 73 65 64 20 66 6f | 72 20 74 68 69 73 20 65 | used fo|r this e| |000008f0| 6e 74 72 79 20 28 69 2e | 65 2e 2c 20 74 68 65 20 |ntry (i.|e., the | |00000900| 6c 61 73 74 20 36 34 20 | 65 6e 74 72 69 65 73 20 |last 64 |entries | |00000910| 77 69 6c 6c 20 62 65 20 | 72 65 74 61 69 6e 65 64 |will be |retained| |00000920| 29 2e 20 4e 6f 74 65 20 | 74 68 61 74 20 49 6e 69 |). Note |that Ini| |00000930| 74 41 75 64 69 74 20 6d | 61 79 20 6f 6e 6c 79 20 |tAudit m|ay only | |00000940| 62 65 20 63 61 6c 6c 65 | 64 20 66 72 6f 6d 20 61 |be calle|d from a| |00000950| 70 70 6c 69 63 61 74 69 | 6f 6e 73 20 6f 72 20 63 |pplicati|ons or c| |00000960| 6f 64 65 2d 73 65 67 6d | 65 6e 74 73 20 74 68 61 |ode-segm|ents tha| |00000970| 74 20 63 61 6e 20 61 6c | 6c 6f 63 61 74 65 20 6d |t can al|locate m| |00000980| 65 6d 6f 72 79 2e 20 49 | 6e 20 74 68 65 20 66 6f |emory. I|n the fo| |00000990| 6c 6c 6f 77 69 6e 67 20 | 65 78 61 6d 70 6c 65 2c |llowing |example,| |000009a0| 20 69 74 20 69 73 20 63 | 61 6c 6c 65 64 20 66 72 | it is c|alled fr| |000009b0| 6f 6d 20 61 20 64 69 73 | 70 6c 61 79 20 61 70 70 |om a dis|play app| |000009c0| 6c 69 63 61 74 69 6f 6e | 20 74 68 61 74 20 61 6c |lication| that al| |000009d0| 73 6f 20 69 6e 69 74 69 | 61 6c 69 7a 65 73 20 74 |so initi|alizes t| |000009e0| 68 65 20 74 69 6d 65 20 | 66 6f 72 6d 61 74 20 70 |he time |format p| |000009f0| 61 72 61 6d 65 74 65 72 | 20 68 61 6e 64 6c 65 20 |arameter| handle | |00000a00| 61 6e 64 20 72 65 63 6f | 72 64 73 20 74 68 65 20 |and reco|rds the | |00000a10| 73 74 61 72 74 20 74 69 | 6d 65 73 2e 0d 76 6f 69 |start ti|mes..voi| |00000a20| 64 0d 49 6e 69 74 69 61 | 6c 69 7a 65 41 75 64 69 |d.Initia|lizeAudi| |00000a30| 74 28 0d 09 09 4f 53 54 | 79 70 65 09 09 09 61 75 |t(...OST|ype...au| |00000a40| 64 69 74 53 65 6c 65 63 | 74 6f 72 0d 09 29 0d 7b |ditSelec|tor..).{| |00000a50| 0d 09 09 2f 2a 0d 09 09 | 20 2a 20 43 72 65 61 74 |.../*...| * Creat| |00000a60| 65 20 61 6e 20 61 75 64 | 69 74 20 72 65 63 6f 72 |e an aud|it recor| |00000a70| 64 20 74 68 61 74 20 63 | 61 6e 20 68 6f 6c 64 20 |d that c|an hold | |00000a80| 36 34 20 65 6e 74 72 69 | 65 73 2e 20 4c 6f 67 67 |64 entri|es. Logg| |00000a90| 69 6e 67 20 69 73 0d 09 | 09 20 2a 20 65 6e 61 62 |ing is..|. * enab| |00000aa0| 6c 65 64 20 61 74 20 73 | 74 61 72 74 2e 0d 09 09 |led at s|tart....| |00000ab0| 20 2a 2f 0d 09 09 67 41 | 75 64 69 74 50 74 72 20 | */...gA|uditPtr | |00000ac0| 3d 20 49 6e 69 74 41 75 | 64 69 74 28 61 75 64 69 |= InitAu|dit(audi| |00000ad0| 74 53 65 6c 65 63 74 6f | 72 2c 20 36 34 2c 20 54 |tSelecto|r, 64, T| |00000ae0| 52 55 45 2c 20 46 41 4c | 53 45 29 3b 0d 09 09 53 |RUE, FAL|SE);...S| |00000af0| 74 61 72 74 41 75 64 69 | 74 69 6e 67 28 29 3b 09 |tartAudi|ting();.| |00000b00| 09 2f 2a 20 57 61 6b 65 | 20 6d 65 20 75 70 20 77 |./* Wake| me up w| |00000b10| 68 65 6e 20 74 68 65 72 | 65 20 69 73 20 64 61 74 |hen ther|e is dat| |00000b20| 61 2e 20 53 65 65 20 62 | 65 6c 6f 77 09 09 2a 2f |a. See b|elow..*/| |00000b30| 0d 09 09 41 75 64 69 74 | 53 74 72 69 6e 67 28 67 |...Audit|String(g| |00000b40| 41 75 64 69 74 50 74 72 | 2c 20 22 5c 70 48 65 6c |AuditPtr|, "\pHel| |00000b50| 6c 6f 20 77 6f 72 6c 64 | 21 22 29 3b 09 2f 2a 20 |lo world|!");./* | |00000b60| 49 6e 69 74 69 61 6c 20 | 65 6e 74 72 79 09 09 09 |Initial |entry...| |00000b70| 09 2a 2f 0d 7d 0d 53 70 | 65 63 69 66 79 69 6e 67 |.*/.}.Sp|ecifying| |00000b80| 20 74 68 65 20 64 69 73 | 70 6c 61 79 20 61 70 70 | the dis|play app| |00000b90| 6c 69 63 61 74 69 6f 6e | 0d 55 6e 64 65 72 20 53 |lication|.Under S| |00000ba0| 79 73 74 65 6d 20 37 2c | 20 74 68 65 20 64 69 73 |ystem 7,| the dis| |00000bb0| 70 6c 61 79 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |play app|lication| |00000bc0| 20 73 68 6f 75 6c 64 20 | 69 6e 66 6f 72 6d 20 74 | should |inform t| |00000bd0| 68 65 20 41 75 64 69 74 | 20 6c 69 62 72 61 72 79 |he Audit| library| |00000be0| 20 74 68 61 74 20 69 74 | 20 69 73 20 74 6f 20 62 | that it| is to b| |00000bf0| 65 20 61 77 61 6b 65 6e | 65 64 20 66 72 6f 6d 20 |e awaken|ed from | |00000c00| 69 74 73 20 65 76 65 6e | 74 20 6c 6f 6f 70 20 77 |its even|t loop w| |00000c10| 68 65 6e 65 76 65 72 20 | 64 61 74 61 20 69 73 20 |henever |data is | |00000c20| 73 74 6f 72 65 64 20 69 | 6e 20 74 68 65 20 61 75 |stored i|n the au| |00000c30| 64 69 74 20 72 65 63 6f | 72 64 2e 20 54 68 69 73 |dit reco|rd. This| |00000c40| 20 61 6c 6c 6f 77 73 20 | 74 68 65 20 64 69 73 70 | allows |the disp| |00000c50| 6c 61 79 20 61 70 70 6c | 69 63 61 74 69 6f 6e 20 |lay appl|ication | |00000c60| 74 6f 20 73 65 74 20 61 | 20 6c 6f 6e 67 20 73 6c |to set a| long sl| |00000c70| 65 65 70 20 74 69 6d 65 | 20 77 68 65 6e 20 69 74 |eep time| when it| |00000c80| 20 63 61 6c 6c 73 20 57 | 61 69 74 4e 65 78 74 45 | calls W|aitNextE| |00000c90| 76 65 6e 74 2e 20 49 6e | 20 74 68 65 20 66 6f 6c |vent. In| the fol| |00000ca0| 6c 6f 77 69 6e 67 20 65 | 78 61 6d 70 6c 65 2c 20 |lowing e|xample, | |00000cb0| 53 74 61 72 74 41 75 64 | 69 74 69 6e 67 20 73 68 |StartAud|iting sh| |00000cc0| 6f 75 6c 64 20 62 65 20 | 63 61 6c 6c 65 64 20 69 |ould be |called i| |00000cd0| 6d 6d 65 64 69 61 74 65 | 6c 79 20 61 66 74 65 72 |mmediate|ly after| |00000ce0| 20 79 6f 75 72 20 64 69 | 73 70 6c 61 79 20 61 70 | your di|splay ap| |00000cf0| 70 6c 69 63 61 74 69 6f | 6e 20 63 72 65 61 74 65 |plicatio|n create| |00000d00| 73 20 61 6e 20 61 75 64 | 69 74 20 72 65 63 6f 72 |s an aud|it recor| |00000d10| 64 20 28 6f 72 20 63 61 | 6c 6c 73 20 47 65 74 41 |d (or ca|lls GetA| |00000d20| 75 64 69 74 50 74 72 20 | 74 6f 20 64 65 74 65 72 |uditPtr |to deter| |00000d30| 6d 69 6e 65 20 74 68 61 | 74 20 61 6e 20 61 75 64 |mine tha|t an aud| |00000d40| 69 74 20 72 65 63 6f 72 | 64 20 61 6c 72 65 61 64 |it recor|d alread| |00000d50| 79 20 65 78 69 73 74 73 | 29 2e 20 53 74 6f 70 41 |y exists|). StopA| |00000d60| 75 64 69 74 69 6e 67 20 | 73 68 6f 75 6c 64 20 62 |uditing |should b| |00000d70| 65 20 63 61 6c 6c 65 64 | 20 62 65 66 6f 72 65 20 |e called| before | |00000d80| 79 6f 75 72 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |your app|lication| |00000d90| 20 65 78 69 74 73 2e 0d | 76 6f 69 64 0d 53 74 61 | exits..|void.Sta| |00000da0| 72 74 41 75 64 69 74 69 | 6e 67 28 76 6f 69 64 29 |rtAuditi|ng(void)| |00000db0| 0d 7b 0d 09 09 4f 53 45 | 72 72 09 09 09 09 09 73 |.{...OSE|rr.....s| |00000dc0| 74 61 74 75 73 3b 0d 09 | 09 6c 6f 6e 67 09 09 09 |tatus;..|.long...| |00000dd0| 09 09 67 65 73 74 61 6c | 74 52 65 73 75 6c 74 3b |..gestal|tResult;| |00000de0| 0d 09 09 73 74 61 74 75 | 73 20 3d 20 47 65 73 74 |...statu|s = Gest| |00000df0| 61 6c 74 28 67 65 73 74 | 61 6c 74 4f 53 41 74 74 |alt(gest|altOSAtt| |00000e00| 72 2c 20 26 67 65 73 74 | 61 6c 74 52 65 73 75 6c |r, &gest|altResul| |00000e10| 74 29 3b 0d 09 09 69 66 | 20 28 73 74 61 74 75 73 |t);...if| (status| |00000e20| 20 3d 3d 20 6e 6f 45 72 | 72 0d 09 09 20 26 26 20 | == noEr|r... && | |00000e30| 28 67 65 73 74 61 6c 74 | 52 65 73 75 6c 74 20 26 |(gestalt|Result &| |00000e40| 20 28 31 20 3c 3c 20 67 | 65 73 74 61 6c 74 4c 61 | (1 << g|estaltLa| |00000e50| 75 6e 63 68 43 6f 6e 74 | 72 6f 6c 29 29 20 21 3d |unchCont|rol)) !=| |00000e60| 20 30 29 20 7b 0d 09 09 | 09 47 65 74 43 75 72 72 | 0) {...|.GetCurr| |00000e70| 65 6e 74 50 72 6f 63 65 | 73 73 28 26 6f 6c 64 50 |entProce|ss(&oldP| |00000e80| 53 4e 29 3b 0d 09 09 09 | 57 61 6b 65 55 70 41 75 |SN);....|WakeUpAu| |00000e90| 64 69 74 28 67 41 75 64 | 69 74 50 74 72 2c 20 26 |dit(gAud|itPtr, &| |00000ea0| 6f 6c 64 50 53 4e 29 3b | 0d 09 09 09 67 48 61 73 |oldPSN);|....gHas| |00000eb0| 50 53 4e 20 3d 20 54 52 | 55 45 3b 0d 09 09 7d 0d |PSN = TR|UE;...}.| |00000ec0| 09 09 65 6c 73 65 20 7b | 0d 09 09 09 67 48 61 73 |..else {|....gHas| |00000ed0| 50 53 4e 20 3d 20 46 41 | 4c 53 45 3b 0d 09 09 7d |PSN = FA|LSE;...}| |00000ee0| 0d 7d 0d 76 6f 69 64 0d | 53 74 6f 70 41 75 64 69 |.}.void.|StopAudi| |00000ef0| 74 69 6e 67 28 76 6f 69 | 64 29 0d 7b 0d 09 09 69 |ting(voi|d).{...i| |00000f00| 66 20 28 67 48 61 73 50 | 53 4e 29 0d 09 09 09 57 |f (gHasP|SN)....W| |00000f10| 61 6b 65 55 70 50 72 6f | 63 65 73 73 28 67 41 75 |akeUpPro|cess(gAu| |00000f20| 64 69 74 50 74 72 2c 20 | 26 6f 6c 64 50 53 4e 29 |ditPtr, |&oldPSN)| |00000f30| 3b 0d 7d 0d 4f 6e 63 65 | 20 79 6f 75 72 20 61 70 |;.}.Once| your ap| |00000f40| 70 6c 69 63 61 74 69 6f | 6e 20 63 61 6c 6c 73 20 |plicatio|n calls | |00000f50| 53 74 61 72 74 41 75 64 | 69 74 69 6e 67 2c 20 69 |StartAud|iting, i| |00000f60| 74 20 77 69 6c 6c 20 72 | 65 63 65 69 76 65 20 61 |t will r|eceive a| |00000f70| 6e 20 65 76 65 6e 74 20 | 77 68 65 6e 65 76 65 72 |n event |whenever| |00000f80| 20 61 6e 79 74 68 69 6e | 67 20 63 61 6c 6c 73 20 | anythin|g calls | |00000f90| 41 75 64 69 74 20 66 6f | 72 20 74 68 69 73 20 61 |Audit fo|r this a| |00000fa0| 75 64 69 74 20 72 65 63 | 6f 72 64 2e 0d 57 72 69 |udit rec|ord..Wri| |00000fb0| 74 69 6e 67 20 61 6e 20 | 41 75 64 69 74 20 20 52 |ting an |Audit R| |00000fc0| 65 63 6f 72 64 20 45 6e | 74 72 79 0d 54 68 65 20 |ecord En|try.The | |00000fd0| 66 6f 6c 6c 6f 77 69 6e | 67 20 63 6f 64 65 20 73 |followin|g code s| |00000fe0| 65 71 75 65 6e 63 65 20 | 73 68 6f 77 73 20 68 6f |equence |shows ho| |00000ff0| 77 20 74 68 65 20 6c 69 | 62 72 61 72 79 20 6d 69 |w the li|brary mi| |00001000| 67 68 74 20 62 65 20 75 | 73 65 64 20 74 6f 20 6c |ght be u|sed to l| |00001010| 6f 67 20 73 74 61 74 75 | 73 20 65 72 72 6f 72 73 |og statu|s errors| |00001020| 2e 20 49 74 20 77 6f 75 | 6c 64 20 62 65 20 63 61 |. It wou|ld be ca| |00001030| 6c 6c 65 64 20 69 6d 6d | 65 64 69 61 74 65 6c 79 |lled imm|ediately| |00001040| 20 61 66 74 65 72 20 63 | 61 6c 6c 69 6e 67 20 61 | after c|alling a| |00001050| 20 6c 69 62 72 61 72 79 | 20 66 75 6e 63 74 69 6f | library| functio| |00001060| 6e 2e 20 49 6e 20 74 68 | 65 20 65 78 61 6d 70 6c |n. In th|e exampl| |00001070| 65 2c 20 74 68 65 20 61 | 70 70 6c 69 63 61 74 69 |e, the a|pplicati| |00001080| 6f 6e 20 74 72 69 65 73 | 20 74 6f 20 72 65 61 64 |on tries| to read| |00001090| 20 64 61 74 61 20 66 72 | 6f 6d 20 61 20 66 69 6c | data fr|om a fil| |000010a0| 65 20 61 6e 64 20 6c 6f | 67 73 20 61 6e 79 20 65 |e and lo|gs any e| |000010b0| 72 72 6f 72 73 20 74 68 | 61 74 20 61 72 65 20 72 |rrors th|at are r| |000010c0| 65 74 75 72 6e 65 64 3a | 0d 09 0d 09 73 74 61 74 |eturned:|....stat| |000010d0| 75 73 20 3d 20 46 53 52 | 65 61 64 28 72 65 66 4e |us = FSR|ead(refN| |000010e0| 75 6d 2c 20 26 62 79 74 | 65 73 54 6f 52 65 61 64 |um, &byt|esToRead| |000010f0| 2c 20 62 75 66 66 65 72 | 29 3b 0d 09 09 69 66 20 |, buffer|);...if | |00001100| 28 73 74 61 74 75 73 20 | 21 3d 20 6e 6f 45 72 72 |(status |!= noErr| |00001110| 29 20 7b 0d 09 09 09 69 | 66 20 28 73 74 61 74 75 |) {....i|f (statu| |00001120| 73 20 21 3d 20 65 6f 66 | 45 72 72 29 20 7b 0d 09 |s != eof|Err) {..| |00001130| 09 09 09 2f 2a 0d 09 09 | 09 09 20 2a 20 55 6e 65 |.../*...|.. * Une| |00001140| 78 70 65 63 74 65 64 20 | 65 72 72 6f 72 0d 09 09 |xpected |error...| |00001150| 09 09 20 2a 2f 0d 09 09 | 09 09 41 75 64 69 74 53 |.. */...|..AuditS| |00001160| 74 61 74 75 73 4c 6f 63 | 61 74 69 6f 6e 28 67 41 |tatusLoc|ation(gA| |00001170| 75 64 69 74 50 74 72 2c | 20 27 52 65 61 64 27 2c |uditPtr,| 'Read',| |00001180| 20 73 74 61 74 75 73 29 | 3b 0d 09 09 09 09 41 75 | status)|;.....Au| |00001190| 64 69 74 28 0d 09 09 09 | 09 09 67 41 75 64 69 74 |dit(....|..gAudit| |000011a0| 50 74 72 2c 0d 09 09 09 | 09 09 27 52 65 61 64 27 |Ptr,....|..'Read'| |000011b0| 2c 0d 09 09 09 09 09 41 | 75 64 69 74 46 6f 72 6d |,......A|uditForm| |000011c0| 61 74 35 28 0d 09 09 09 | 09 09 09 6b 41 75 64 69 |at5(....|...kAudi| |000011d0| 74 46 6f 72 6d 61 74 53 | 69 67 6e 65 64 2c 0d 09 |tFormatS|igned,..| |000011e0| 09 09 09 09 09 6b 41 75 | 64 69 74 46 6f 72 6d 61 |.....kAu|ditForma| |000011f0| 74 53 69 67 6e 65 64 2c | 0d 09 09 09 09 09 09 6b |tSigned,|.......k| |00001200| 41 75 64 69 74 46 6f 72 | 6d 61 74 55 6e 73 69 67 |AuditFor|matUnsig| |00001210| 6e 65 64 2c 0d 09 09 09 | 09 09 09 6b 41 75 64 69 |ned,....|...kAudi| |00001220| 74 46 6f 72 6d 61 74 41 | 64 64 72 65 73 73 0d 09 |tFormatA|ddress..| |00001230| 09 09 09 09 09 6b 41 75 | 64 69 74 46 6f 72 6d 61 |.....kAu|ditForma| |00001240| 74 53 74 72 69 6e 67 0d | 09 09 09 09 09 29 2c 0d |tString.|.....),.| |00001250| 09 09 09 09 09 28 73 69 | 67 6e 65 64 20 6c 6f 6e |.....(si|gned lon| |00001260| 67 29 20 73 74 61 74 75 | 73 2c 0d 09 09 09 09 09 |g) statu|s,......| |00001270| 28 73 69 67 6e 65 64 20 | 6c 6f 6e 67 29 20 72 65 |(signed |long) re| |00001280| 66 4e 75 6d 2c 0d 09 09 | 09 09 09 62 79 74 65 73 |fNum,...|...bytes| |00001290| 54 6f 52 65 61 64 2c 0d | 09 09 09 09 09 62 75 66 |ToRead,.|.....buf| |000012a0| 66 65 72 2c 0d 09 09 09 | 09 09 22 5c 70 46 53 52 |fer,....|.."\pFSR| |000012b0| 65 61 64 22 0d 09 09 09 | 09 29 3b 0d 09 09 09 7d |ead"....|.);....}| |000012c0| 0d 09 09 7d 0d 54 68 69 | 73 20 65 78 61 6d 70 6c |...}.Thi|s exampl| |000012d0| 65 20 73 68 6f 77 73 20 | 74 77 6f 20 41 75 64 69 |e shows |two Audi| |000012e0| 74 20 63 61 6c 6c 73 3a | 20 74 68 65 20 41 75 64 |t calls:| the Aud| |000012f0| 69 74 53 74 61 74 75 73 | 20 6d 61 63 72 6f 20 73 |itStatus| macro s| |00001300| 74 6f 72 65 73 20 74 68 | 65 20 73 74 61 74 75 73 |tores th|e status| |00001310| 20 63 6f 64 65 20 61 6e | 64 20 61 20 73 74 72 69 | code an|d a stri| |00001320| 6e 67 20 74 68 61 74 20 | 69 64 65 6e 74 69 66 69 |ng that |identifi| |00001330| 65 73 20 74 68 65 20 66 | 75 6e 63 74 69 6f 6e 20 |es the f|unction | |00001340| 74 68 61 74 20 63 61 6c | 6c 65 64 20 69 74 2c 20 |that cal|led it, | |00001350| 77 68 69 6c 65 20 74 68 | 65 20 67 65 6e 65 72 61 |while th|e genera| |00001360| 6c 20 41 75 64 69 74 20 | 63 61 6c 6c 20 73 74 6f |l Audit |call sto| |00001370| 72 65 73 20 66 69 76 65 | 20 76 61 6c 75 65 73 3a |res five| values:| |00001380| 20 74 68 65 20 73 74 61 | 74 75 73 20 63 6f 64 65 | the sta|tus code| |00001390| 2c 20 64 65 76 69 63 65 | 20 72 65 66 65 72 65 6e |, device| referen| |000013a0| 63 65 20 6e 75 6d 62 65 | 72 2c 20 6e 75 6d 62 65 |ce numbe|r, numbe| |000013b0| 72 20 6f 66 20 62 79 74 | 65 73 2c 20 62 75 66 66 |r of byt|es, buff| |000013c0| 65 72 20 61 64 64 72 65 | 73 73 2c 20 61 6e 64 20 |er addre|ss, and | |000013d0| 61 20 6c 61 62 65 6c 6c | 69 6e 67 20 73 74 72 69 |a labell|ing stri| |000013e0| 6e 67 2e 0d 52 65 61 64 | 69 6e 67 20 61 6e 20 41 |ng..Read|ing an A| |000013f0| 75 64 69 74 20 20 52 65 | 63 6f 72 64 20 45 6e 74 |udit Re|cord Ent| |00001400| 72 79 0d 41 20 74 79 70 | 69 63 61 6c 20 64 69 73 |ry.A typ|ical dis| |00001410| 70 6c 61 79 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |play app|lication| |00001420| 20 63 61 6c 6c 73 20 52 | 65 61 64 41 75 64 69 74 | calls R|eadAudit| |00001430| 20 65 61 63 68 20 74 69 | 6d 65 20 77 69 74 68 69 | each ti|me withi| |00001440| 6e 20 69 74 73 20 65 76 | 65 6e 74 20 6c 6f 6f 70 |n its ev|ent loop| |00001450| 2c 20 65 76 65 6e 20 69 | 66 20 6e 6f 20 65 76 65 |, even i|f no eve| |00001460| 6e 74 20 77 61 73 20 72 | 65 74 75 72 6e 65 64 3a |nt was r|eturned:| |00001470| 0d 09 09 66 6f 72 20 28 | 69 20 3d 20 30 3b 20 69 |...for (|i = 0; i| |00001480| 20 3c 20 31 30 3b 20 69 | 2b 2b 29 20 7b 0d 09 09 | < 10; i|++) {...| |00001490| 09 69 66 20 28 52 65 61 | 64 41 75 64 69 74 28 67 |.if (Rea|dAudit(g| |000014a0| 41 75 64 69 74 50 74 72 | 2c 20 26 67 4d 69 73 73 |AuditPtr|, &gMiss| |000014b0| 65 64 44 61 74 61 43 6f | 75 6e 74 2c 20 26 67 43 |edDataCo|unt, &gC| |000014c0| 75 72 72 65 6e 74 45 6e | 74 72 79 29 20 3d 3d 20 |urrentEn|try) == | |000014d0| 46 41 4c 53 45 29 0d 09 | 09 09 09 62 72 65 61 6b |FALSE)..|...break| |000014e0| 3b 09 09 09 09 09 2f 2a | 20 4e 6f 74 68 69 6e 67 |;...../*| Nothing| |000014f0| 20 6d 6f 72 65 20 74 6f | 20 64 69 73 70 6c 61 79 | more to| display| |00001500| 09 2a 2f 0d 09 09 09 50 | 72 6f 63 65 73 73 41 75 |.*/....P|rocessAu| |00001510| 64 69 74 45 6e 74 72 79 | 28 29 3b 0d 09 09 7d 0d |ditEntry|();...}.| |00001520| 48 65 72 65 2c 20 6e 6f | 74 65 20 74 68 61 74 20 |Here, no|te that | |00001530| 65 61 63 68 20 70 61 73 | 73 20 74 68 72 6f 75 67 |each pas|s throug| |00001540| 68 20 74 68 65 20 65 76 | 65 6e 74 20 6c 6f 6f 70 |h the ev|ent loop| |00001550| 20 74 72 69 65 73 20 74 | 6f 20 70 72 6f 63 65 73 | tries t|o proces| |00001560| 73 20 73 65 76 65 72 61 | 6c 20 61 75 64 69 74 20 |s severa|l audit | |00001570| 72 65 63 6f 72 64 73 2c | 20 65 78 69 74 69 6e 67 |records,| exiting| |00001580| 20 77 68 65 6e 20 74 68 | 65 20 d2 74 6f 20 62 65 | when th|e .to be| |00001590| 20 64 6f 6e 65 d3 20 71 | 75 65 75 65 20 69 73 20 | done. q|ueue is | |000015a0| 65 6d 70 74 79 2c 20 6f | 72 20 61 20 72 65 61 73 |empty, o|r a reas| |000015b0| 6f 6e 61 62 6c 65 20 6e | 75 6d 62 65 72 20 68 61 |onable n|umber ha| |000015c0| 76 65 20 62 65 65 6e 20 | 70 72 6f 63 65 73 73 65 |ve been |processe| |000015d0| 64 2e 20 50 72 6f 63 65 | 73 73 69 6e 67 20 65 6e |d. Proce|ssing en| |000015e0| 74 72 69 65 73 20 69 6e | 20 61 20 6c 6f 6f 70 20 |tries in| a loop | |000015f0| 73 75 63 68 20 61 73 20 | 74 68 65 20 6f 6e 65 20 |such as |the one | |00001600| 73 68 6f 77 6e 20 61 62 | 6f 76 65 20 6d 61 79 20 |shown ab|ove may | |00001610| 70 72 65 76 65 6e 74 20 | 61 20 72 75 6e 2d 61 77 |prevent |a run-aw| |00001620| 61 79 20 61 73 79 63 68 | 72 6f 6e 6f 75 73 20 70 |ay asych|ronous p| |00001630| 72 6f 63 65 73 73 20 66 | 72 6f 6d 20 61 62 73 6f |rocess f|rom abso| |00001640| 72 62 69 6e 67 20 74 68 | 65 20 65 6e 74 69 72 65 |rbing th|e entire| |00001650| 20 6d 61 63 68 69 6e 65 | 20 62 79 20 73 61 74 75 | machine| by satu| |00001660| 72 61 74 69 6e 67 20 74 | 68 65 20 61 75 64 69 74 |rating t|he audit| |00001670| 20 72 65 63 6f 72 64 2e | 0d 59 6f 75 72 20 64 69 | record.|.Your di| |00001680| 73 70 6c 61 79 20 61 70 | 70 6c 69 63 61 74 69 6f |splay ap|plicatio| |00001690| 6e 20 77 6f 75 6c 64 20 | 70 72 6f 63 65 73 73 20 |n would |process | |000016a0| 61 6e 20 61 75 64 69 74 | 20 65 6e 74 72 79 20 62 |an audit| entry b| |000016b0| 79 20 66 6f 72 6d 61 74 | 74 69 6e 67 20 74 68 65 |y format|ting the| |000016c0| 20 65 6e 74 72 79 20 72 | 65 63 6f 72 64 2c 20 69 | entry r|ecord, i| |000016d0| 6e 63 6c 75 64 69 6e 67 | 20 74 68 65 20 74 69 6d |ncluding| the tim| |000016e0| 65 73 74 61 6d 70 2c 20 | 69 64 20 63 6f 64 65 2c |estamp, |id code,| |000016f0| 20 61 6e 64 20 64 61 74 | 61 2e 20 0d 44 69 73 70 | and dat|a. .Disp| |00001700| 6c 61 79 69 6e 67 20 74 | 68 65 20 41 75 64 69 74 |laying t|he Audit| |00001710| 20 45 6e 74 72 79 20 44 | 61 74 61 0d 54 77 6f 20 | Entry D|ata.Two | |00001720| 66 75 6e 63 74 69 6f 6e | 73 20 61 72 65 20 70 72 |function|s are pr| |00001730| 6f 76 69 64 65 64 20 28 | 69 6e 20 66 69 6c 65 20 |ovided (|in file | |00001740| 41 75 64 69 74 45 6e 74 | 72 79 46 6f 72 6d 61 74 |AuditEnt|ryFormat| |00001750| 2e 63 29 20 74 68 61 74 | 20 63 6f 6e 76 65 72 74 |.c) that| convert| |00001760| 20 74 68 65 20 61 75 64 | 69 74 20 65 6e 74 72 79 | the aud|it entry| |00001770| 20 72 65 63 6f 72 64 20 | 69 6e 74 6f 20 72 65 61 | record |into rea| |00001780| 64 61 62 6c 65 20 50 61 | 73 63 61 6c 20 73 74 72 |dable Pa|scal str| |00001790| 69 6e 67 73 2e 0d a5 09 | 54 68 65 20 46 6f 72 6d |ings....|The Form| |000017a0| 61 74 41 75 64 69 74 45 | 6e 74 72 79 54 69 6d 65 |atAuditE|ntryTime| |000017b0| 73 74 61 6d 70 20 66 75 | 6e 63 74 69 6f 6e 20 64 |stamp fu|nction d| |000017c0| 65 74 65 72 6d 69 6e 65 | 73 20 74 68 65 20 74 69 |etermine|s the ti| |000017d0| 6d 65 20 74 68 61 74 20 | 61 6e 20 61 75 64 69 74 |me that |an audit| |000017e0| 20 65 6e 74 72 79 20 77 | 61 73 20 63 72 65 61 74 | entry w|as creat| |000017f0| 65 64 2c 20 73 74 6f 72 | 69 6e 67 20 69 74 20 69 |ed, stor|ing it i| |00001800| 6e 20 61 20 50 61 73 63 | 61 6c 20 73 74 72 69 6e |n a Pasc|al strin| |00001810| 67 20 62 75 66 66 65 72 | 2e 20 54 68 65 20 20 74 |g buffer|. The t| |00001820| 69 6d 65 20 69 73 20 67 | 69 76 65 6e 20 69 6e 20 |ime is g|iven in | |00001830| 49 53 4f 2d 73 74 61 6e | 64 61 72 64 20 64 61 74 |ISO-stan|dard dat| |00001840| 65 20 66 6f 72 6d 61 74 | 20 61 73 20 20 d2 79 79 |e format| as .yy| |00001850| 79 79 2e 6d 6d 2e 64 64 | ca 68 68 2e 6d 6d 2e 73 |yy.mm.dd|.hh.mm.s| |00001860| 73 2e 6d 73 65 63 2e d3 | 20 54 68 69 73 20 69 73 |s.msec..| This is| |00001870| 20 61 20 66 69 78 65 64 | 2d 6c 65 6e 67 74 68 20 | a fixed|-length | |00001880| 73 74 72 69 6e 67 20 77 | 68 6f 73 65 20 66 6f 72 |string w|hose for| |00001890| 6d 61 74 20 69 73 20 69 | 6e 64 65 70 65 6e 64 65 |mat is i|ndepende| |000018a0| 6e 74 20 6f 66 20 74 68 | 65 20 75 73 65 72 d5 73 |nt of th|e user.s| |000018b0| 20 74 69 6d 65 20 61 6e | 64 20 64 61 74 65 20 66 | time an|d date f| |000018c0| 6f 72 6d 61 74 74 69 6e | 67 20 63 68 6f 69 63 65 |ormattin|g choice| |000018d0| 2e 0d a5 09 54 68 65 20 | 46 6f 72 6d 61 74 41 75 |....The |FormatAu| |000018e0| 64 69 74 44 61 74 61 20 | 66 75 6e 63 74 69 6f 6e |ditData |function| |000018f0| 20 63 6f 6e 76 65 72 74 | 73 20 74 68 65 20 64 61 | convert|s the da| |00001900| 74 61 20 70 6f 72 74 69 | 6f 6e 20 6f 66 20 74 68 |ta porti|on of th| |00001910| 65 20 61 75 64 69 74 20 | 65 6e 74 72 79 20 72 65 |e audit |entry re| |00001920| 63 6f 72 64 2c 20 73 74 | 6f 72 69 6e 67 20 69 74 |cord, st|oring it| |00001930| 20 61 73 20 61 20 50 61 | 73 63 61 6c 20 73 74 72 | as a Pa|scal str| |00001940| 69 6e 67 2e 0d 46 6f 72 | 20 65 78 61 6d 70 6c 65 |ing..For| example| |00001950| 2c 20 74 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 20 |, the fo|llowing | |00001960| 43 20 73 65 71 75 65 6e | 63 65 20 6d 61 79 20 62 |C sequen|ce may b| |00001970| 65 20 75 73 65 64 20 74 | 6f 20 70 72 69 6e 74 20 |e used t|o print | |00001980| 61 6e 20 61 75 64 69 74 | 20 65 6e 74 72 79 20 72 |an audit| entry r| |00001990| 65 63 6f 72 64 3a 0d 76 | 6f 69 64 0d 46 6f 72 6d |ecord:.v|oid.Form| |000019a0| 61 74 45 6e 74 72 79 44 | 61 74 61 28 76 6f 69 64 |atEntryD|ata(void| |000019b0| 29 0d 7b 0d 09 09 53 74 | 72 32 35 35 09 09 09 09 |).{...St|r255....| |000019c0| 09 74 69 6d 65 73 74 61 | 6d 70 3b 0d 09 09 53 74 |.timesta|mp;...St| |000019d0| 72 32 35 35 09 09 09 09 | 09 63 6f 6e 74 65 6e 74 |r255....|.content| |000019e0| 3b 0d 23 64 65 66 69 6e | 65 20 45 4e 54 52 59 09 |;.#defin|e ENTRY.| |000019f0| 28 67 43 75 72 72 65 6e | 74 45 6e 74 72 79 29 0d |(gCurren|tEntry).| |00001a00| 09 09 2f 2a 0d 09 09 20 | 2a 20 67 4c 6f 67 49 6e |../*... |* gLogIn| |00001a10| 64 65 78 20 69 73 20 74 | 68 65 20 73 65 71 75 65 |dex is t|he seque| |00001a20| 6e 63 65 20 6e 75 6d 62 | 65 72 20 6f 66 20 74 68 |nce numb|er of th| |00001a30| 69 73 20 65 6e 74 72 79 | 2e 20 4e 6f 74 65 20 74 |is entry|. Note t| |00001a40| 68 61 74 20 69 74 20 74 | 72 61 63 6b 73 0d 09 09 |hat it t|racks...| |00001a50| 20 2a 20 6d 69 73 73 69 | 6e 67 20 65 6e 74 72 69 | * missi|ng entri| |00001a60| 65 73 3a 20 69 2e 65 2e | 20 69 74 20 72 65 63 6f |es: i.e.| it reco| |00001a70| 72 64 73 20 74 68 65 20 | 73 65 71 75 65 6e 63 65 |rds the |sequence| |00001a80| 20 6f 66 20 41 75 64 69 | 74 20 63 61 6c 6c 73 2e | of Audi|t calls.| |00001a90| 0d 09 09 20 2a 2f 0d 09 | 09 67 4c 6f 67 49 6e 64 |... */..|.gLogInd| |00001aa0| 65 78 20 3d 20 67 4c 6f | 67 49 6e 64 65 78 20 2b |ex = gLo|gIndex +| |00001ab0| 20 45 4e 54 52 59 2e 6c | 6f 73 74 44 61 74 61 20 | ENTRY.l|ostData | |00001ac0| 2b 20 31 3b 0d 09 09 46 | 6f 72 6d 61 74 41 75 64 |+ 1;...F|ormatAud| |00001ad0| 69 74 45 6e 74 72 79 54 | 69 6d 65 73 74 61 6d 70 |itEntryT|imestamp| |00001ae0| 28 67 41 75 64 69 74 50 | 74 72 2c 20 26 45 4e 54 |(gAuditP|tr, &ENT| |00001af0| 52 59 2c 20 74 69 6d 65 | 73 74 61 6d 70 29 3b 0d |RY, time|stamp);.| |00001b00| 09 09 46 6f 72 6d 61 74 | 41 75 64 69 74 45 6e 74 |..Format|AuditEnt| |00001b10| 72 79 44 61 74 61 28 26 | 45 4e 54 52 59 2c 20 63 |ryData(&|ENTRY, c| |00001b20| 6f 6e 74 65 6e 74 29 3b | 0d 09 09 70 72 69 6e 74 |ontent);|...print| |00001b30| 66 28 22 25 36 6c 75 22 | 2c 20 67 4c 6f 67 49 6e |f("%6lu"|, gLogIn| |00001b40| 64 65 78 29 3b 0d 09 09 | 70 72 69 6e 74 66 28 22 |dex);...|printf("| |00001b50| 20 25 2e 2a 73 3a 22 2c | 20 74 69 6d 65 73 74 61 | %.*s:",| timesta| |00001b60| 6d 70 5b 30 5d 2c 20 26 | 74 69 6d 65 73 74 61 6d |mp[0], &|timestam| |00001b70| 70 5b 31 5d 29 3b 0d 09 | 09 70 72 69 6e 74 66 28 |p[1]);..|.printf(| |00001b80| 22 20 25 2e 2a 73 5c 6e | 22 2c 20 63 6f 6e 74 65 |" %.*s\n|", conte| |00001b90| 6e 74 5b 30 5d 2c 20 26 | 63 6f 6e 74 65 6e 74 5b |nt[0], &|content[| |00001ba0| 31 5d 29 3b 0d 7d 0d 54 | 68 65 20 73 6f 75 72 63 |1]);.}.T|he sourc| |00001bb0| 65 20 6f 66 20 46 6f 72 | 6d 61 74 41 75 64 69 74 |e of For|matAudit| |00001bc0| 45 6e 74 72 79 54 69 6d | 65 73 74 61 6d 70 20 61 |EntryTim|estamp a| |00001bd0| 6e 64 20 46 6f 72 6d 61 | 74 41 75 64 69 74 45 6e |nd Forma|tAuditEn| |00001be0| 74 72 79 44 61 74 61 20 | 73 68 6f 75 6c 64 20 62 |tryData |should b| |00001bf0| 65 20 63 6f 6e 73 75 6c | 74 65 64 20 74 6f 20 73 |e consul|ted to s| |00001c00| 65 65 20 68 6f 77 20 74 | 6f 20 70 72 6f 63 65 73 |ee how t|o proces| |00001c10| 73 20 74 68 65 20 65 6e | 74 72 79 20 64 61 74 61 |s the en|try data| |00001c20| 2c 20 69 6e 63 6c 75 64 | 69 6e 67 20 63 6f 6e 76 |, includ|ing conv| |00001c30| 65 72 74 69 6e 67 20 74 | 68 65 20 74 69 6d 65 73 |erting t|he times| |00001c40| 74 61 6d 70 20 61 6e 64 | 20 d2 64 65 63 6f 6d 70 |tamp and| .decomp| |00001c50| 69 6c 69 6e 67 d3 20 74 | 68 65 20 66 6f 72 6d 61 |iling. t|he forma| |00001c60| 74 74 65 64 20 64 61 74 | 61 2e 20 54 68 65 20 70 |tted dat|a. The p| |00001c70| 72 69 6e 74 66 20 66 6f | 72 6d 61 74 20 77 72 69 |rintf fo|rmat wri| |00001c80| 74 65 73 20 74 68 65 20 | 70 61 73 63 61 6c 20 73 |tes the |pascal s| |00001c90| 74 72 69 6e 67 20 69 6e | 20 61 20 66 6f 72 6d 61 |tring in| a forma| |00001ca0| 74 20 63 6f 6d 70 61 74 | 69 62 6c 65 20 77 69 74 |t compat|ible wit| |00001cb0| 68 20 74 68 65 20 41 4e | 53 49 20 73 74 61 6e 64 |h the AN|SI stand| |00001cc0| 61 72 64 2e 20 54 68 69 | 6e 6b 20 43 20 75 73 65 |ard. Thi|nk C use| |00001cd0| 72 73 20 63 61 6e 20 61 | 6c 73 6f 20 75 73 65 20 |rs can a|lso use | |00001ce0| 61 6e 20 69 6d 70 6c 65 | 6d 65 6e 74 61 74 69 6f |an imple|mentatio| |00001cf0| 6e 2d 73 70 65 63 69 66 | 69 63 20 66 6f 72 6d 61 |n-specif|ic forma| |00001d00| 74 20 64 65 73 69 67 6e | 61 74 6f 72 20 66 6f 72 |t design|ator for| |00001d10| 20 50 61 73 63 61 6c 20 | 73 74 72 69 6e 67 73 3a | Pascal |strings:| |00001d20| 20 22 25 23 73 22 2e 0d | 41 55 44 49 54 20 52 45 | "%#s"..|AUDIT RE| |00001d30| 43 4f 52 44 20 44 41 54 | 41 0d 54 68 65 20 61 75 |CORD DAT|A.The au| |00001d40| 64 69 74 20 6c 69 62 72 | 61 72 79 20 75 73 65 73 |dit libr|ary uses| |00001d50| 20 61 20 70 72 69 76 61 | 74 65 20 64 61 74 61 20 | a priva|te data | |00001d60| 61 72 65 61 20 69 6e 20 | 74 68 65 20 53 79 73 74 |area in |the Syst| |00001d70| 65 6d 20 48 65 61 70 20 | 74 6f 20 73 74 6f 72 65 |em Heap |to store| |00001d80| 20 69 74 73 20 69 6e 66 | 6f 72 6d 61 74 69 6f 6e | its inf|ormation| |00001d90| 2e 20 49 6e 69 74 41 75 | 64 69 74 20 61 6e 64 20 |. InitAu|dit and | |00001da0| 47 65 74 41 75 64 69 74 | 50 74 72 20 72 65 74 75 |GetAudit|Ptr retu| |00001db0| 72 6e 20 61 20 70 6f 69 | 6e 74 65 72 20 74 6f 20 |rn a poi|nter to | |00001dc0| 74 68 61 74 20 61 72 65 | 61 2c 20 61 6e 64 20 61 |that are|a, and a| |00001dd0| 6c 6c 20 6f 74 68 65 72 | 20 66 75 6e 63 74 69 6f |ll other| functio| |00001de0| 6e 73 20 75 73 65 20 74 | 68 61 74 20 70 6f 69 6e |ns use t|hat poin| |00001df0| 74 65 72 20 61 73 20 61 | 20 70 61 72 61 6d 65 74 |ter as a| paramet| |00001e00| 65 72 2e 20 54 68 65 20 | 63 6f 6e 74 65 6e 74 73 |er. The |contents| |00001e10| 20 6f 66 20 74 68 65 20 | 61 72 65 61 20 61 72 65 | of the |area are| |00001e20| 20 70 72 69 76 61 74 65 | 3a 20 79 6f 75 72 20 61 | private|: your a| |00001e30| 70 70 6c 69 63 61 74 69 | 6f 6e 20 64 6f 65 73 20 |pplicati|on does | |00001e40| 6e 6f 74 20 61 63 63 65 | 73 73 20 74 68 69 73 20 |not acce|ss this | |00001e50| 72 65 63 6f 72 64 20 64 | 69 72 65 63 74 6c 79 2c |record d|irectly,| |00001e60| 20 62 75 74 20 63 61 6c | 6c 73 20 6c 69 62 72 61 | but cal|ls libra| |00001e70| 72 79 20 72 6f 75 74 69 | 6e 65 73 2e 20 54 68 69 |ry routi|nes. Thi| |00001e80| 73 20 69 73 20 69 6d 70 | 6f 72 74 61 6e 74 20 74 |s is imp|ortant t| |00001e90| 6f 20 70 72 65 76 65 6e | 74 20 61 73 79 63 68 72 |o preven|t asychr| |00001ea0| 6f 6e 6f 75 73 20 63 61 | 6c 6c 73 20 28 66 72 6f |onous ca|lls (fro| |00001eb0| 6d 20 69 6e 74 65 72 72 | 75 70 74 20 72 6f 75 74 |m interr|upt rout| |00001ec0| 69 6e 65 73 2c 20 66 6f | 72 20 65 78 61 6d 70 6c |ines, fo|r exampl| |00001ed0| 65 29 20 66 72 6f 6d 20 | 61 63 63 65 73 73 69 6e |e) from |accessin| |00001ee0| 67 20 74 68 65 20 64 61 | 74 61 20 73 69 6d 75 6c |g the da|ta simul| |00001ef0| 74 61 6e 65 6f 75 73 6c | 79 2e 0d 59 6f 75 72 20 |taneousl|y..Your | |00001f00| 64 69 73 70 6c 61 79 20 | 61 70 70 6c 69 63 61 74 |display |applicat| |00001f10| 69 6f 6e 20 64 6f 65 73 | 20 6e 65 65 64 20 74 6f |ion does| need to| |00001f20| 20 75 6e 64 65 72 73 74 | 61 6e 64 20 74 68 65 20 | underst|and the | |00001f30| 66 6f 72 6d 61 74 20 6f | 66 20 74 68 65 20 61 75 |format o|f the au| |00001f40| 64 69 74 20 65 6e 74 72 | 79 20 72 65 63 6f 72 64 |dit entr|y record| |00001f50| 20 74 68 61 74 20 69 73 | 20 72 65 74 75 72 6e 65 | that is| returne| |00001f60| 64 20 62 79 20 52 65 61 | 64 41 75 64 69 74 2e 20 |d by Rea|dAudit. | |00001f70| 54 68 69 73 20 63 6f 6e | 74 61 69 6e 73 20 74 68 |This con|tains th| |00001f80| 65 20 69 6e 66 6f 72 6d | 61 74 69 6f 6e 20 74 68 |e inform|ation th| |00001f90| 61 74 20 77 61 73 20 73 | 74 6f 72 65 64 20 61 73 |at was s|tored as| |00001fa0| 20 61 20 72 65 73 75 6c | 74 20 6f 66 20 61 6e 20 | a resul|t of an | |00001fb0| 41 75 64 69 74 20 63 61 | 6c 6c 2e 0d 41 75 64 69 |Audit ca|ll..Audi| |00001fc0| 74 20 45 6e 74 72 79 20 | 43 6f 6e 74 65 6e 74 73 |t Entry |Contents| |00001fd0| 0d 52 65 61 64 41 75 64 | 69 74 2e 20 69 66 20 73 |.ReadAud|it. if s| |00001fe0| 75 63 63 65 73 73 66 75 | 6c 2c 20 72 65 74 75 72 |uccessfu|l, retur| |00001ff0| 6e 73 20 61 6e 20 61 75 | 64 69 74 20 72 65 63 6f |ns an au|dit reco| |00002000| 72 64 20 65 6e 74 72 79 | 2e 20 54 68 69 73 20 69 |rd entry|. This i| |00002010| 73 20 61 20 43 20 73 74 | 72 75 63 74 75 72 65 20 |s a C st|ructure | |00002020| 77 69 74 68 20 74 68 65 | 20 66 6f 6c 6c 6f 77 69 |with the| followi| |00002030| 6e 67 20 66 6f 72 6d 61 | 74 3a 0d 74 79 70 65 64 |ng forma|t:.typed| |00002040| 65 66 20 73 74 72 75 63 | 74 20 41 75 64 69 74 45 |ef struc|t AuditE| |00002050| 6e 74 72 79 20 7b 0d 09 | 75 6e 73 69 67 6e 65 64 |ntry {..|unsigned| |00002060| 20 6c 6f 6e 67 09 74 69 | 63 6b 43 6f 75 6e 74 3b | long.ti|ckCount;| |00002070| 09 2f 2a 20 54 69 63 6b | 43 6f 75 6e 74 28 29 20 |./* Tick|Count() | |00002080| 61 74 20 63 61 6c 6c 09 | 2a 2f 0d 09 75 6e 73 69 |at call.|*/..unsi| |00002090| 67 6e 65 64 20 6c 6f 6e | 67 09 6c 6f 73 74 44 61 |gned lon|g.lostDa| |000020a0| 74 61 3b 09 2f 2a 20 4c | 6f 73 74 20 72 65 63 6f |ta;./* L|ost reco| |000020b0| 72 64 20 63 6f 75 6e 74 | 09 2a 2f 0d 09 4f 53 54 |rd count|.*/..OST| |000020c0| 79 70 65 09 69 64 43 6f | 64 65 3b 09 2f 2a 20 57 |ype.idCo|de;./* W| |000020d0| 68 79 20 61 72 65 20 77 | 65 20 6c 6f 67 67 69 6e |hy are w|e loggin| |000020e0| 67 09 2a 2f 0d 09 75 6e | 73 69 67 6e 65 64 20 6c |g.*/..un|signed l| |000020f0| 6f 6e 67 09 66 6f 72 6d | 61 74 3b 09 2f 2a 20 46 |ong.form|at;./* F| |00002100| 6f 72 6d 61 74 20 6f 66 | 20 74 68 65 20 64 61 74 |ormat of| the dat| |00002110| 61 09 2a 2f 0d 09 75 6e | 73 69 67 6e 65 64 20 6c |a.*/..un|signed l| |00002120| 6f 6e 67 09 64 61 74 61 | 5b 38 5d 3b 09 2f 2a 20 |ong.data|[8];./* | |00002130| 33 32 2d 62 79 74 65 73 | 20 6f 66 20 64 61 74 61 |32-bytes| of data| |00002140| 09 2a 2f 0d 7d 20 41 75 | 64 69 74 45 6e 74 72 79 |.*/.} Au|ditEntry| |00002150| 2c 20 2a 41 75 64 69 74 | 45 6e 74 72 79 50 74 72 |, *Audit|EntryPtr| |00002160| 3b 0d 54 68 65 20 73 74 | 72 75 63 74 75 72 65 20 |;.The st|ructure | |00002170| 65 6c 65 6d 65 6e 74 73 | 20 61 72 65 20 75 73 65 |elements| are use| |00002180| 64 20 61 73 20 66 6f 6c | 6c 6f 77 73 3a 0d 74 69 |d as fol|lows:.ti| |00002190| 63 6b 43 6f 75 6e 74 09 | 54 68 69 73 20 76 61 6c |ckCount.|This val| |000021a0| 75 65 20 74 69 6d 65 73 | 74 61 6d 70 73 20 65 61 |ue times|tamps ea| |000021b0| 63 68 20 65 6e 74 72 79 | 3a 20 69 74 20 69 73 20 |ch entry|: it is | |000021c0| 74 68 65 20 76 61 6c 75 | 65 20 6f 66 20 54 69 63 |the valu|e of Tic| |000021d0| 6b 73 20 77 68 65 6e 20 | 74 68 65 20 65 6c 65 6d |ks when |the elem| |000021e0| 65 6e 74 20 77 61 73 20 | 77 72 69 74 74 65 6e 20 |ent was |written | |000021f0| 69 6e 74 6f 20 74 68 65 | 20 6c 6f 67 2e 09 0d 6c |into the| log...l| |00002200| 6f 73 74 44 61 74 61 09 | 54 68 69 73 20 69 73 20 |ostData.|This is | |00002210| 73 65 74 20 74 6f 20 74 | 68 65 20 6e 75 6d 62 65 |set to t|he numbe| |00002220| 72 20 6f 66 20 65 6e 74 | 72 69 65 73 20 74 68 61 |r of ent|ries tha| |00002230| 74 20 77 65 72 65 20 6e | 6f 74 20 6c 6f 67 67 65 |t were n|ot logge| |00002240| 64 20 62 65 63 61 75 73 | 65 20 74 68 65 20 6c 6f |d becaus|e the lo| |00002250| 67 20 61 72 65 61 20 77 | 61 73 20 66 75 6c 6c 2e |g area w|as full.| |00002260| 20 45 61 63 68 20 74 69 | 6d 65 20 41 75 64 69 74 | Each ti|me Audit| |00002270| 20 73 74 6f 72 65 73 20 | 61 20 6c 6f 67 20 65 6e | stores |a log en| |00002280| 74 72 79 2c 20 69 74 20 | 63 6f 70 69 65 73 20 69 |try, it |copies i| |00002290| 74 73 20 69 6e 74 65 72 | 6e 61 6c 20 6c 6f 73 74 |ts inter|nal lost| |000022a0| 44 61 74 61 20 63 6f 75 | 6e 74 65 72 20 74 6f 20 |Data cou|nter to | |000022b0| 74 68 65 20 6e 65 77 20 | 61 75 64 69 74 20 65 6e |the new |audit en| |000022c0| 74 72 79 2c 20 74 68 65 | 6e 20 73 65 74 73 20 69 |try, the|n sets i| |000022d0| 74 73 20 69 6e 74 65 72 | 6e 61 6c 20 63 6f 75 6e |ts inter|nal coun| |000022e0| 74 65 72 20 74 6f 20 7a | 65 72 6f 2e 20 54 68 69 |ter to z|ero. Thi| |000022f0| 73 20 6d 65 61 6e 73 20 | 74 68 61 74 20 74 68 65 |s means |that the| |00002300| 20 6c 6f 73 74 44 61 74 | 61 20 63 6f 75 6e 74 65 | lostDat|a counte| |00002310| 72 20 69 73 20 73 79 6e | 63 68 72 6f 6e 69 7a 65 |r is syn|chronize| |00002320| 64 20 77 69 74 68 20 64 | 61 74 61 20 6c 6f 67 67 |d with d|ata logg| |00002330| 69 6e 67 3a 20 69 66 20 | 69 74 20 69 73 20 6e 6f |ing: if |it is no| |00002340| 6e 2d 7a 65 72 6f 2c 20 | 74 68 61 74 20 6e 75 6d |n-zero, |that num| |00002350| 62 65 72 20 6f 66 20 41 | 75 64 69 74 20 63 61 6c |ber of A|udit cal| |00002360| 6c 73 20 77 65 72 65 20 | 75 6e 73 75 63 63 65 73 |ls were |unsucces| |00002370| 73 66 75 6c 20 69 6d 6d | 65 64 69 61 74 65 6c 79 |sful imm|ediately| |00002380| 20 62 65 66 6f 72 65 20 | 74 68 69 73 20 72 65 63 | before |this rec| |00002390| 6f 72 64 2e 09 0d 69 64 | 43 6f 64 65 09 54 68 69 |ord...id|Code.Thi| |000023a0| 73 20 76 61 6c 75 65 20 | 69 73 20 74 68 65 20 69 |s value |is the i| |000023b0| 64 43 6f 64 65 20 70 61 | 72 61 6d 65 74 65 72 20 |dCode pa|rameter | |000023c0| 77 68 65 6e 20 41 75 64 | 69 74 20 77 61 73 20 63 |when Aud|it was c| |000023d0| 61 6c 6c 65 64 20 74 6f | 20 73 74 6f 72 65 20 74 |alled to| store t| |000023e0| 68 69 73 20 72 65 63 6f | 72 64 2e 20 59 6f 75 72 |his reco|rd. Your| |000023f0| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 20 6d 61 79 | applica|tion may| |00002400| 20 75 73 65 20 69 74 20 | 66 6f 72 20 61 6e 79 20 | use it |for any | |00002410| 70 75 72 70 6f 73 65 20 | 68 6f 77 65 76 65 72 2c |purpose |however,| |00002420| 20 62 79 20 63 6f 6e 76 | 65 6e 74 69 6f 6e 2c 20 | by conv|ention, | |00002430| 69 74 20 69 73 20 61 6e | 20 4f 53 54 79 70 65 20 |it is an| OSType | |00002440| 28 66 6f 75 72 20 63 68 | 61 72 61 63 74 65 72 20 |(four ch|aracter | |00002450| 73 74 72 69 6e 67 29 20 | 74 68 61 74 20 66 75 72 |string) |that fur| |00002460| 74 68 65 72 20 69 64 65 | 6e 74 69 66 69 65 73 20 |ther ide|ntifies | |00002470| 74 68 65 20 41 75 64 69 | 74 20 63 61 6c 6c 2e 09 |the Audi|t call..| |00002480| 0d 66 6f 72 6d 61 74 09 | 54 68 69 73 20 69 73 20 |.format.|This is | |00002490| 74 68 65 20 66 6f 72 6d | 61 74 20 70 61 72 61 6d |the form|at param| |000024a0| 65 74 65 72 20 77 68 65 | 6e 20 41 75 64 69 74 20 |eter whe|n Audit | |000024b0| 77 61 73 20 63 61 6c 6c | 65 64 20 74 6f 20 73 74 |was call|ed to st| |000024c0| 6f 72 65 20 74 68 69 73 | 20 72 65 63 6f 72 64 2e |ore this| record.| |000024d0| 20 49 74 20 64 65 66 69 | 6e 65 73 20 74 68 65 20 | It defi|nes the | |000024e0| 66 6f 72 6d 61 74 20 6f | 66 20 74 68 65 20 72 65 |format o|f the re| |000024f0| 73 74 20 6f 66 20 74 68 | 65 20 72 65 63 6f 72 64 |st of th|e record| |00002500| 2e 09 0d 64 61 74 61 09 | 54 68 69 73 20 63 6f 6e |...data.|This con| |00002510| 74 61 69 6e 73 20 74 68 | 65 20 61 63 74 75 61 6c |tains th|e actual| |00002520| 20 64 61 74 61 20 73 74 | 6f 72 65 64 20 62 79 20 | data st|ored by | |00002530| 74 68 65 20 41 75 64 69 | 74 20 63 61 6c 6c 2e 20 |the Audi|t call. | |00002540| 54 68 65 72 65 20 69 73 | 20 65 6e 6f 75 67 68 20 |There is| enough | |00002550| 73 70 61 63 65 20 66 6f | 72 20 75 70 20 74 6f 20 |space fo|r up to | |00002560| 65 69 67 68 74 20 6c 6f | 6e 67 77 6f 72 64 73 2e |eight lo|ngwords.| |00002570| 20 53 6f 6d 65 20 66 6f | 72 6d 61 74 20 70 61 72 | Some fo|rmat par| |00002580| 61 6d 65 74 65 72 73 20 | 73 74 6f 72 65 20 61 20 |ameters |store a | |00002590| 73 74 72 69 6e 67 20 77 | 68 69 63 68 20 63 61 6e |string w|hich can| |000025a0| 20 74 61 6b 65 20 75 70 | 20 74 68 65 20 72 65 6d | take up| the rem| |000025b0| 61 69 6e 69 6e 67 20 73 | 70 61 63 65 2e 20 46 6f |aining s|pace. Fo| |000025c0| 72 20 65 78 61 6d 70 6c | 65 2c 20 69 66 20 74 68 |r exampl|e, if th| |000025d0| 65 20 6f 6e 6c 79 20 70 | 61 72 61 6d 65 74 65 72 |e only p|arameter| |000025e0| 20 69 73 20 6b 41 75 64 | 69 74 46 6f 72 6d 61 74 | is kAud|itFormat| |000025f0| 53 74 72 69 6e 67 2c 20 | 75 70 20 74 6f 20 33 31 |String, |up to 31| |00002600| 20 62 79 74 65 73 20 28 | 70 6c 75 73 20 61 20 6f | bytes (|plus a o| |00002610| 6e 65 2d 62 79 74 65 20 | 6c 65 6e 67 74 68 20 63 |ne-byte |length c| |00002620| 6f 64 65 29 20 6d 61 79 | 20 62 65 20 73 74 6f 72 |ode) may| be stor| |00002630| 65 64 2e 09 0d 57 68 69 | 6c 65 20 70 72 6f 63 65 |ed...Whi|le proce| |00002640| 73 73 69 6e 67 20 74 68 | 69 73 20 64 61 74 61 20 |ssing th|is data | |00002650| 69 73 20 6e 6f 74 20 65 | 73 70 65 63 69 61 6c 6c |is not e|speciall| |00002660| 79 20 74 72 69 63 6b 79 | 2c 20 79 6f 75 20 6d 61 |y tricky|, you ma| |00002670| 79 20 77 69 73 68 20 74 | 6f 20 72 65 2d 72 65 61 |y wish t|o re-rea| |00002680| 64 20 74 68 65 20 73 61 | 6d 70 6c 65 20 63 6f 64 |d the sa|mple cod| |00002690| 65 20 74 6f 20 75 6e 73 | 65 72 73 74 61 6e 64 20 |e to uns|erstand | |000026a0| 68 6f 77 20 74 6f 20 66 | 6f 72 6d 61 74 20 74 68 |how to f|ormat th| |000026b0| 65 20 64 61 74 61 20 76 | 61 6c 75 65 73 2e 0d 41 |e data v|alues..A| |000026c0| 75 64 69 74 20 52 45 43 | 4f 52 44 20 43 6f 6e 74 |udit REC|ORD Cont| |000026d0| 65 6e 74 73 0d 54 68 65 | 20 41 75 64 69 74 20 6c |ents.The| Audit l| |000026e0| 69 62 72 61 72 79 20 6b | 65 65 70 73 20 61 6c 6c |ibrary k|eeps all| |000026f0| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 20 69 74 20 | informa|tion it | |00002700| 6e 65 65 64 73 20 69 6e | 20 70 72 69 76 61 74 65 |needs in| private| |00002710| 20 73 74 72 75 63 74 75 | 72 65 73 2e 20 49 74 20 | structu|res. It | |00002720| 69 73 20 65 73 73 65 6e | 74 69 61 6c 20 74 6f 20 |is essen|tial to | |00002730| 75 6e 64 65 72 73 74 61 | 6e 64 20 74 68 61 74 20 |understa|nd that | |00002740| 75 73 65 72 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |user app|lication| |00002750| 73 20 6d 75 73 74 20 6e | 6f 74 20 6d 6f 64 69 66 |s must n|ot modif| |00002760| 79 20 74 68 65 73 65 20 | 73 74 72 75 63 74 75 72 |y these |structur| |00002770| 65 20 64 69 72 65 63 74 | 6c 79 3a 20 74 68 65 79 |e direct|ly: they| |00002780| 20 61 72 65 20 64 65 73 | 63 72 69 62 65 64 20 68 | are des|cribed h| |00002790| 65 72 65 20 66 6f 72 20 | 64 65 76 65 6c 6f 70 65 |ere for |develope| |000027a0| 72 73 20 77 68 6f 20 6e | 65 65 64 20 74 6f 20 6d |rs who n|eed to m| |000027b0| 6f 64 69 66 79 20 74 68 | 65 20 6c 69 62 72 61 72 |odify th|e librar| |000027c0| 79 20 66 6f 72 20 74 68 | 65 69 72 20 6f 77 6e 20 |y for th|eir own | |000027d0| 73 70 65 63 69 66 69 63 | 20 70 75 72 70 6f 73 65 |specific| purpose| |000027e0| 73 2e 20 4e 6f 74 65 20 | 61 6c 73 6f 20 74 68 61 |s. Note |also tha| |000027f0| 74 20 74 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 20 |t the fo|llowing | |00002800| 68 61 73 20 62 65 65 6e | 20 73 69 6d 70 6c 69 66 |has been| simplif| |00002810| 69 65 64 20 73 6c 69 67 | 68 74 6c 79 3a 20 74 68 |ied slig|htly: th| |00002820| 65 20 61 63 74 75 61 6c | 20 41 75 64 69 74 52 65 |e actual| AuditRe| |00002830| 63 6f 72 64 20 68 61 73 | 20 73 6f 6d 65 20 61 64 |cord has| some ad| |00002840| 64 69 74 69 6f 6e 61 6c | 20 73 74 72 75 63 74 75 |ditional| structu| |00002850| 72 65 73 20 74 6f 20 70 | 72 65 73 65 72 76 65 20 |res to p|reserve | |00002860| 63 6f 6d 70 61 74 69 62 | 69 6c 69 74 79 20 62 65 |compatib|ility be| |00002870| 74 77 65 65 6e 20 54 68 | 69 6e 6b 20 43 20 61 6e |tween Th|ink C an| |00002880| 64 20 4d 50 57 20 63 6f | 6d 70 69 6c 61 74 69 6f |d MPW co|mpilatio| |00002890| 6e 20 63 6f 6e 76 65 6e | 74 69 6f 6e 73 2e 0d 74 |n conven|tions..t| |000028a0| 79 70 65 64 65 66 20 73 | 74 72 75 63 74 20 41 75 |ypedef s|truct Au| |000028b0| 64 69 74 51 75 65 75 65 | 45 6e 74 72 79 20 7b 0d |ditQueue|Entry {.| |000028c0| 09 51 45 6c 65 6d 50 74 | 72 09 71 4c 69 6e 6b 3b |.QElemPt|r.qLink;| |000028d0| 09 2f 2a 20 51 75 65 75 | 65 20 6c 69 6e 6b 61 67 |./* Queu|e linkag| |000028e0| 65 09 2a 2f 0d 09 41 75 | 64 69 74 45 6e 74 72 79 |e.*/..Au|ditEntry| |000028f0| 09 74 68 65 45 6e 74 72 | 79 3b 09 2f 2a 20 55 73 |.theEntr|y;./* Us| |00002900| 65 72 d5 73 20 64 61 74 | 61 20 61 72 65 61 09 2a |er.s dat|a area.*| |00002910| 2f 0d 7d 20 41 75 64 69 | 74 51 75 65 75 65 45 6e |/.} Audi|tQueueEn| |00002920| 74 72 79 2c 20 2a 41 75 | 64 69 74 51 75 65 75 65 |try, *Au|ditQueue| |00002930| 45 6e 74 72 79 50 74 72 | 3b 0d 74 79 70 65 64 65 |EntryPtr|;.typede| |00002940| 66 20 73 74 72 75 63 74 | 20 41 75 64 69 74 52 65 |f struct| AuditRe| |00002950| 63 6f 72 64 20 7b 0d 09 | 75 6e 69 6f 6e 20 7b 0d |cord {..|union {.| |00002960| 09 20 20 20 20 76 6f 69 | 64 09 2a 75 6e 75 73 65 |. voi|d.*unuse| |00002970| 64 4c 6f 6e 67 77 6f 72 | 64 3b 0d 09 20 20 20 20 |dLongwor|d;.. | |00002980| 73 74 72 75 63 74 20 7b | 0d 09 20 20 20 20 20 20 |struct {|.. | |00002990| 20 20 75 6e 73 69 67 6e | 65 64 20 73 68 6f 72 74 | unsign|ed short| |000029a0| 09 6c 6f 77 3b 09 2f 2a | 20 45 61 72 6c 69 65 73 |.low;./*| Earlies| |000029b0| 74 20 6c 69 62 20 76 65 | 72 73 69 6f 6e 09 2a 2f |t lib ve|rsion.*/| |000029c0| 0d 09 20 20 20 20 20 20 | 20 20 75 6e 73 69 67 6e |.. | unsign| |000029d0| 65 64 20 73 68 6f 72 74 | 09 68 69 67 68 3b 09 2f |ed short|.high;./| |000029e0| 2a 20 4c 61 74 65 73 74 | 20 6c 69 62 20 76 65 72 |* Latest| lib ver| |000029f0| 73 69 6f 6e 09 2a 2f 0d | 09 20 20 20 20 7d 20 75 |sion.*/.|. } u| |00002a00| 3b 0d 09 7d 20 76 65 72 | 73 69 6f 6e 3b 0d 09 75 |;..} ver|sion;..u| |00002a10| 6e 73 69 67 6e 65 64 20 | 6c 6f 6e 67 09 72 65 63 |nsigned |long.rec| |00002a20| 6f 72 64 53 69 7a 65 3b | 09 2f 2a 20 43 6f 6d 70 |ordSize;|./* Comp| |00002a30| 69 6c 65 72 20 63 68 65 | 63 6b 09 2a 2f 0d 09 75 |iler che|ck.*/..u| |00002a40| 6e 73 69 67 6e 65 64 20 | 6c 6f 6e 67 09 6c 6f 73 |nsigned |long.los| |00002a50| 74 44 61 74 61 3b 09 2f | 2a 20 4d 69 73 73 65 64 |tData;./|* Missed| |00002a60| 20 6c 6f 67 20 63 6f 75 | 6e 74 65 72 09 2a 2f 0d | log cou|nter.*/.| |00002a70| 09 76 6f 69 64 09 2a 72 | 65 66 4e 75 6d 3b 09 2f |.void.*r|efNum;./| |00002a80| 2a 20 55 73 65 72 2d 63 | 6f 6e 74 72 6f 6c 6c 65 |* User-c|ontrolle| |00002a90| 64 20 6c 6f 6e 67 09 2a | 2f 0d 09 75 6e 73 69 67 |d long.*|/..unsig| |00002aa0| 6e 65 64 20 6c 6f 6e 67 | 09 66 6c 61 67 73 3b 09 |ned long|.flags;.| |00002ab0| 2f 2a 20 4c 6f 67 67 69 | 6e 67 20 26 20 70 72 65 |/* Loggi|ng & pre| |00002ac0| 66 65 72 65 6e 63 65 09 | 2a 2f 0d 09 75 6e 73 69 |ference.|*/..unsi| |00002ad0| 67 6e 65 64 20 6c 6f 6e | 67 09 74 69 6d 65 41 74 |gned lon|g.timeAt| |00002ae0| 53 74 61 72 74 3b 20 20 | 2f 2a 20 47 65 74 44 61 |Start; |/* GetDa| |00002af0| 74 65 54 69 6d 65 28 29 | 09 2a 2f 0d 09 75 6e 73 |teTime()|.*/..uns| |00002b00| 69 67 6e 65 64 20 6c 6f | 6e 67 09 74 69 63 6b 73 |igned lo|ng.ticks| |00002b10| 41 74 53 74 61 72 74 3b | 20 2f 2a 20 54 69 63 6b |AtStart;| /* Tick| |00002b20| 43 6f 75 6e 74 28 29 09 | 2a 2f 0d 09 50 72 6f 63 |Count().|*/..Proc| |00002b30| 65 73 73 53 65 72 69 61 | 6c 4e 75 6d 62 65 72 09 |essSeria|lNumber.| |00002b40| 50 53 4e 3b 09 2f 2a 20 | 57 61 6b 65 75 70 20 74 |PSN;./* |Wakeup t| |00002b50| 68 69 73 20 70 72 6f 63 | 65 73 73 09 2a 2f 0d 09 |his proc|ess.*/..| |00002b60| 75 6e 73 69 67 6e 65 64 | 20 6c 6f 6e 67 09 6c 6f |unsigned| long.lo| |00002b70| 67 69 63 61 6c 52 41 4d | 53 69 7a 65 3b 20 2f 2a |gicalRAM|Size; /*| |00002b80| 20 46 72 6f 6d 20 47 65 | 73 74 61 6c 74 09 2a 2f | From Ge|stalt.*/| |00002b90| 0d 09 51 48 64 72 09 66 | 72 65 65 51 75 65 75 65 |..QHdr.f|reeQueue| |00002ba0| 3b 09 2f 2a 20 46 72 65 | 65 20 71 75 65 75 65 20 |;./* Fre|e queue | |00002bb0| 68 65 61 64 65 72 09 2a | 2f 0d 09 51 48 64 72 09 |header.*|/..QHdr.| |00002bc0| 64 61 74 61 51 75 65 75 | 65 3b 09 2f 2a 20 42 75 |dataQueu|e;./* Bu| |00002bd0| 73 79 20 71 75 65 75 65 | 20 68 65 61 64 65 72 09 |sy queue| header.| |00002be0| 2a 2f 0d 09 41 75 64 69 | 74 51 75 65 75 65 45 6e |*/..Audi|tQueueEn| |00002bf0| 74 72 79 09 65 6e 74 72 | 69 65 73 5b 31 5d 3b 09 |try.entr|ies[1];.| |00002c00| 2f 2a 20 45 6e 74 72 69 | 65 73 20 73 74 6f 72 65 |/* Entri|es store| |00002c10| 64 20 68 65 72 65 09 2a | 2f 0d 7d 20 41 75 64 69 |d here.*|/.} Audi| |00002c20| 74 52 65 63 6f 72 64 2c | 20 2a 41 75 64 69 74 50 |tRecord,| *AuditP| |00002c30| 74 72 3b 0d 54 68 65 20 | 73 74 72 75 63 74 75 72 |tr;.The |structur| |00002c40| 65 20 65 6c 65 6d 65 6e | 74 73 20 61 72 65 20 75 |e elemen|ts are u| |00002c50| 73 65 64 20 61 73 20 66 | 6f 6c 6c 6f 77 73 3a 0d |sed as f|ollows:.| |00002c60| 76 65 72 73 69 6f 6e 09 | 54 68 69 73 20 33 32 2d |version.|This 32-| |00002c70| 62 69 74 20 76 61 6c 75 | 65 20 70 65 72 6d 69 74 |bit valu|e permit| |00002c80| 73 20 64 69 66 66 65 72 | 65 6e 74 20 76 65 72 73 |s differ|ent vers| |00002c90| 69 6f 6e 73 20 6f 66 20 | 74 68 65 20 41 75 64 69 |ions of |the Audi| |00002ca0| 74 20 6c 69 62 72 61 72 | 79 20 74 6f 20 63 6f 2d |t librar|y to co-| |00002cb0| 65 78 69 73 74 2e 20 49 | 6e 69 74 41 75 64 69 74 |exist. I|nitAudit| |00002cc0| 20 73 65 74 73 20 74 68 | 65 73 65 20 76 61 6c 75 | sets th|ese valu| |00002cd0| 65 73 2e 20 54 68 65 6e | 2c 20 61 6c 6c 20 63 61 |es. Then|, all ca| |00002ce0| 6c 6c 73 20 74 6f 20 47 | 65 74 41 75 64 69 74 50 |lls to G|etAuditP| |00002cf0| 74 72 20 77 69 6c 6c 20 | 76 65 72 69 66 79 20 74 |tr will |verify t| |00002d00| 68 61 74 20 74 68 69 73 | 20 69 6e 73 74 61 6e 63 |hat this| instanc| |00002d10| 65 20 6f 66 20 74 68 65 | 20 6c 69 62 72 61 72 79 |e of the| library| |00002d20| 20 73 75 70 70 6f 72 74 | 73 20 74 68 69 73 20 41 | support|s this A| |00002d30| 75 64 69 74 52 65 63 6f | 72 64 20 66 6f 72 6d 61 |uditReco|rd forma| |00002d40| 74 20 28 49 2e 65 2e 2c | 20 69 73 20 62 61 63 6b |t (I.e.,| is back| |00002d50| 77 61 72 64 73 20 63 6f | 6d 70 61 74 69 62 6c 65 |wards co|mpatible| |00002d60| 20 77 69 74 68 20 65 61 | 72 6c 69 65 72 20 76 65 | with ea|rlier ve| |00002d70| 72 73 69 6f 6e 73 29 2e | 20 76 65 72 73 69 6f 6e |rsions).| version| |00002d80| 2e 75 2e 6c 6f 77 20 69 | 73 20 74 68 65 20 65 61 |.u.low i|s the ea| |00002d90| 72 6c 69 65 73 74 20 6c | 69 62 72 61 72 79 20 76 |rliest l|ibrary v| |00002da0| 65 72 73 69 6f 6e 20 73 | 75 70 70 6f 72 74 65 64 |ersion s|upported| |00002db0| 3b 20 76 65 72 73 69 6f | 6e 2e 75 2e 68 69 67 68 |; versio|n.u.high| |00002dc0| 20 69 73 20 74 68 65 20 | 6c 61 74 65 73 74 2e 20 | is the |latest. | |00002dd0| 45 61 63 68 20 73 68 6f | 72 74 20 69 73 20 64 69 |Each sho|rt is di| |00002de0| 76 69 64 65 64 2c 20 62 | 79 20 63 6f 6e 76 65 6e |vided, b|y conven| |00002df0| 74 69 6f 6e 2c 20 69 6e | 74 6f 20 d2 6d 61 6a 6f |tion, in|to .majo| |00002e00| 72 d3 20 61 6e 64 20 d2 | 6d 69 6e 6f 72 d3 20 72 |r. and .|minor. r| |00002e10| 65 6c 65 61 73 65 20 69 | 64 65 6e 74 69 66 69 63 |elease i|dentific| |00002e20| 61 74 69 6f 6e 20 76 61 | 6c 75 65 73 2e 0d 49 66 |ation va|lues..If| |00002e30| 20 79 6f 75 20 6d 6f 64 | 69 66 79 20 74 68 65 20 | you mod|ify the | |00002e40| 41 75 64 69 74 52 65 63 | 6f 72 64 20 6f 72 20 41 |AuditRec|ord or A| |00002e50| 75 64 69 74 45 6e 74 72 | 79 20 64 65 66 69 6e 69 |uditEntr|y defini| |00002e60| 74 69 6f 6e 73 2c 20 79 | 6f 75 72 20 76 65 72 73 |tions, y|our vers| |00002e70| 69 6f 6e 20 6f 66 20 49 | 6e 69 74 41 75 64 69 74 |ion of I|nitAudit| |00002e80| 20 73 68 6f 75 6c 64 20 | 63 68 61 6e 67 65 20 69 | should |change i| |00002e90| 74 73 20 76 65 72 73 69 | 6f 6e 20 69 64 65 6e 74 |ts versi|on ident| |00002ea0| 69 66 69 65 72 20 73 6f | 20 74 68 61 74 20 79 6f |ifier so| that yo| |00002eb0| 75 72 20 41 75 64 69 74 | 52 65 63 6f 72 64 20 77 |ur Audit|Record w| |00002ec0| 69 6c 6c 20 63 6f 2d 65 | 78 69 73 74 20 70 65 61 |ill co-e|xist pea| |00002ed0| 63 65 66 75 6c 6c 79 20 | 77 69 74 68 20 6f 74 68 |cefully |with oth| |00002ee0| 65 72 20 72 65 63 6f 72 | 64 73 20 74 68 61 74 20 |er recor|ds that | |00002ef0| 6d 61 79 20 62 65 20 6f | 6e 20 79 6f 75 72 20 73 |may be o|n your s| |00002f00| 79 73 74 65 6d 2e 09 0d | 72 65 63 6f 72 64 53 69 |ystem...|recordSi| |00002f10| 7a 65 09 54 68 69 73 20 | 33 32 2d 62 69 74 20 76 |ze.This |32-bit v| |00002f20| 61 6c 75 65 20 63 6f 6e | 74 61 69 6e 73 20 74 68 |alue con|tains th| |00002f30| 65 20 73 69 7a 65 73 20 | 6f 66 20 74 68 65 20 41 |e sizes |of the A| |00002f40| 75 64 69 74 52 65 63 6f | 72 64 20 61 6e 64 20 41 |uditReco|rd and A| |00002f50| 75 64 69 74 45 6e 74 72 | 79 2e 20 49 74 20 70 72 |uditEntr|y. It pr| |00002f60| 65 76 65 6e 74 73 20 74 | 68 65 20 70 72 6f 67 72 |events t|he progr| |00002f70| 61 6d 20 66 72 6f 6d 20 | 63 72 61 73 68 69 6e 67 |am from |crashing| |00002f80| 20 69 66 20 61 20 63 6f | 6d 70 69 6c 65 72 20 63 | if a co|mpiler c| |00002f90| 68 61 6e 67 65 73 20 74 | 68 65 20 77 61 79 20 69 |hanges t|he way i| |00002fa0| 74 20 6f 72 67 61 6e 69 | 7a 65 73 20 64 61 74 61 |t organi|zes data| |00002fb0| 20 69 6e 20 6d 65 6d 6f | 72 79 2e 0d 49 66 20 79 | in memo|ry..If y| |00002fc0| 6f 75 20 6d 6f 64 69 66 | 79 20 74 68 65 20 41 75 |ou modif|y the Au| |00002fd0| 64 69 74 52 65 63 6f 72 | 64 20 6f 72 20 41 75 64 |ditRecor|d or Aud| |00002fe0| 69 74 45 6e 74 72 79 20 | 64 65 66 69 6e 74 69 6f |itEntry |defintio| |00002ff0| 6e 73 2c 20 74 68 69 73 | 20 76 61 6c 75 65 20 77 |ns, this| value w| |00003000| 69 6c 6c 20 62 65 20 72 | 65 63 6f 6d 70 75 74 65 |ill be r|ecompute| |00003010| 64 2e 09 0d 6c 6f 73 74 | 44 61 74 61 09 54 68 69 |d...lost|Data.Thi| |00003020| 73 20 63 6f 75 6e 74 65 | 72 20 6d 61 69 6e 74 61 |s counte|r mainta| |00003030| 69 6e 73 20 74 68 65 20 | 69 6e 74 65 72 6e 61 6c |ins the |internal| |00003040| 20 d2 6c 6f 73 74 20 64 | 61 74 61 d3 20 63 6f 75 | .lost d|ata. cou| |00003050| 6e 74 65 72 2e 20 49 74 | 20 69 73 20 69 6e 63 72 |nter. It| is incr| |00003060| 65 6d 65 6e 74 65 64 20 | 77 68 65 6e 65 76 65 72 |emented |whenever| |00003070| 20 41 75 64 69 74 20 63 | 61 6e 6e 6f 74 20 73 74 | Audit c|annot st| |00003080| 6f 72 65 20 61 6e 20 65 | 6e 74 72 79 20 62 65 63 |ore an e|ntry bec| |00003090| 61 75 73 65 20 74 68 65 | 72 65 20 61 72 65 20 6e |ause the|re are n| |000030a0| 6f 20 65 6e 74 72 69 65 | 73 20 69 6e 20 74 68 65 |o entrie|s in the| |000030b0| 20 66 72 65 65 20 71 75 | 65 75 65 2c 20 61 6e 64 | free qu|eue, and| |000030c0| 20 69 73 20 63 6c 65 61 | 72 65 64 20 74 6f 20 7a | is clea|red to z| |000030d0| 65 72 6f 20 77 68 65 6e | 65 76 65 72 20 41 75 64 |ero when|ever Aud| |000030e0| 69 74 20 73 75 63 63 65 | 73 73 66 75 6c 6c 79 20 |it succe|ssfully | |000030f0| 73 74 6f 72 65 73 20 61 | 6e 20 61 75 64 69 74 20 |stores a|n audit | |00003100| 65 6e 74 72 79 2e 09 0d | 66 6c 61 67 73 09 54 68 |entry...|flags.Th| |00003110| 69 73 20 77 6f 72 64 20 | 63 6f 6e 74 61 69 6e 73 |is word |contains| |00003120| 20 74 77 6f 20 66 6c 61 | 67 20 62 69 74 73 3a 20 | two fla|g bits: | |00003130| 6b 41 75 64 69 74 45 6e | 61 62 6c 65 4d 61 73 6b |kAuditEn|ableMask| |00003140| 20 69 73 20 6e 6f 6e 2d | 7a 65 72 6f 20 69 66 20 | is non-|zero if | |00003150| 6c 6f 67 67 69 6e 67 20 | 69 73 20 65 6e 61 62 6c |logging |is enabl| |00003160| 65 64 2e 20 6b 41 75 64 | 69 74 50 72 65 73 65 72 |ed. kAud|itPreser| |00003170| 76 65 46 69 72 73 74 4d | 61 73 6b 20 69 73 20 6e |veFirstM|ask is n| |00003180| 6f 6e 2d 7a 65 72 6f 20 | 69 66 20 64 61 74 61 20 |on-zero |if data | |00003190| 6f 76 65 72 66 6c 6f 77 | 20 73 68 6f 75 6c 64 20 |overflow| should | |000031a0| 72 65 74 61 69 6e 20 74 | 68 65 20 66 69 72 73 74 |retain t|he first| |000031b0| 20 65 6c 65 6d 65 6e 74 | 73 20 69 6e 20 74 68 65 | element|s in the| |000031c0| 20 6c 6f 67 2e 20 54 68 | 65 20 66 6c 61 67 73 20 | log. Th|e flags | |000031d0| 76 61 72 69 61 62 6c 65 | 20 69 73 20 73 74 6f 72 |variable| is stor| |000031e0| 65 64 20 61 73 20 61 20 | 6c 6f 6e 67 77 6f 72 64 |ed as a |longword| |000031f0| 20 73 6f 20 74 68 61 74 | 20 61 6c 6c 20 72 65 63 | so that| all rec| |00003200| 6f 72 64 20 65 6c 65 6d | 65 6e 74 73 20 61 72 65 |ord elem|ents are| |00003210| 20 61 6c 69 67 6e 65 64 | 20 74 6f 20 33 32 2d 62 | aligned| to 32-b| |00003220| 69 74 20 62 6f 75 6e 64 | 61 72 69 65 73 3a 20 74 |it bound|aries: t| |00003230| 68 69 73 20 69 6d 70 72 | 6f 76 65 73 20 70 65 72 |his impr|oves per| |00003240| 66 6f 72 6d 61 6e 63 65 | 20 6f 6e 20 6d 6f 64 65 |formance| on mode| |00003250| 72 6e 20 68 61 72 64 77 | 61 72 65 2e 09 0d 74 69 |rn hardw|are...ti| |00003260| 6d 65 41 74 53 74 61 72 | 74 09 57 68 65 6e 20 74 |meAtStar|t.When t| |00003270| 68 65 20 41 75 64 69 74 | 52 65 63 6f 72 64 20 69 |he Audit|Record i| |00003280| 73 20 63 72 65 61 74 65 | 64 2c 20 74 68 69 73 20 |s create|d, this | |00003290| 65 6c 65 6d 65 6e 74 20 | 72 65 63 65 69 76 65 73 |element |receives| |000032a0| 20 74 68 65 20 73 79 73 | 74 65 6d 20 74 69 6d 65 | the sys|tem time| |000032b0| 20 28 73 65 63 6f 6e 64 | 73 20 73 69 6e 63 65 20 | (second|s since | |000032c0| 74 68 65 20 65 70 6f 63 | 68 29 2e 09 0d 74 69 63 |the epoc|h)...tic| |000032d0| 6b 73 41 74 53 74 61 72 | 74 09 57 68 65 6e 20 74 |ksAtStar|t.When t| |000032e0| 68 65 20 41 75 64 69 74 | 52 65 63 6f 72 64 20 69 |he Audit|Record i| |000032f0| 73 20 63 72 65 61 74 65 | 64 2c 20 74 68 69 73 20 |s create|d, this | |00003300| 65 6c 65 6d 65 6e 74 20 | 72 65 63 65 69 76 65 73 |element |receives| |00003310| 20 74 68 65 20 73 79 73 | 74 65 6d 20 74 69 63 6b | the sys|tem tick| |00003320| 73 20 76 61 6c 75 65 2e | 09 0d 50 53 4e 09 54 68 |s value.|..PSN.Th| |00003330| 69 73 20 69 64 65 6e 74 | 69 66 69 65 73 20 74 68 |is ident|ifies th| |00003340| 65 20 70 72 6f 63 65 73 | 73 20 74 6f 20 61 77 61 |e proces|s to awa| |00003350| 6b 65 6e 20 77 68 65 6e | 20 64 61 74 61 20 69 73 |ken when| data is| |00003360| 20 73 74 6f 72 65 64 20 | 69 6e 20 74 68 65 20 41 | stored |in the A| |00003370| 75 64 69 74 20 6c 6f 67 | 2e 20 49 66 20 74 68 65 |udit log|. If the| |00003380| 20 68 69 67 68 20 6c 6f | 6e 67 77 6f 72 64 20 69 | high lo|ngword i| |00003390| 73 20 7a 65 72 6f 20 61 | 6e 64 20 74 68 65 20 6c |s zero a|nd the l| |000033a0| 6f 77 20 6c 6f 6e 67 77 | 6f 72 64 20 69 73 20 6b |ow longw|ord is k| |000033b0| 4e 6f 50 72 6f 63 65 73 | 73 2c 20 6e 6f 20 70 72 |NoProces|s, no pr| |000033c0| 6f 63 65 73 73 20 77 69 | 6c 6c 20 62 65 20 61 77 |ocess wi|ll be aw| |000033d0| 61 6b 65 6e 65 64 2e 09 | 0d 6c 6f 67 69 63 61 6c |akened..|.logical| |000033e0| 52 41 4d 53 69 7a 65 09 | 54 68 69 73 20 69 73 20 |RAMSize.|This is | |000033f0| 73 65 74 20 74 6f 20 74 | 68 65 20 65 6e 64 20 6f |set to t|he end o| |00003400| 66 20 6c 6f 67 69 63 61 | 6c 20 52 41 4d 20 77 68 |f logica|l RAM wh| |00003410| 65 6e 20 74 68 65 20 41 | 75 64 69 74 52 65 63 6f |en the A|uditReco| |00003420| 72 64 20 69 73 20 63 72 | 65 61 74 65 64 2e 20 41 |rd is cr|eated. A| |00003430| 75 64 69 74 20 75 73 65 | 73 20 69 74 20 74 6f 20 |udit use|s it to | |00003440| 70 72 65 76 65 6e 74 20 | 61 20 67 61 72 62 61 67 |prevent |a garbag| |00003450| 65 20 61 64 64 72 65 73 | 73 20 70 61 73 73 65 64 |e addres|s passed| |00003460| 20 74 6f 20 74 68 65 20 | 41 75 64 69 74 20 73 74 | to the |Audit st| |00003470| 72 69 6e 67 20 66 6f 72 | 6d 61 74 74 65 72 20 66 |ring for|matter f| |00003480| 72 6f 6d 20 63 61 75 73 | 69 6e 67 20 61 6e 20 61 |rom caus|ing an a| |00003490| 64 64 72 65 73 73 20 65 | 78 63 65 70 74 69 6f 6e |ddress e|xception| |000034a0| 2e 09 0d 66 72 65 65 51 | 75 65 75 65 09 54 68 69 |...freeQ|ueue.Thi| |000034b0| 73 20 6f 70 65 72 61 74 | 69 6e 67 20 73 79 73 74 |s operat|ing syst| |000034c0| 65 6d 20 71 75 65 75 65 | 20 73 74 6f 72 65 73 20 |em queue| stores | |000034d0| 74 68 65 20 61 75 64 69 | 74 20 65 6e 74 72 69 65 |the audi|t entrie| |000034e0| 73 20 74 68 61 74 20 61 | 72 65 20 77 61 69 74 69 |s that a|re waiti| |000034f0| 6e 67 20 74 6f 20 62 65 | 20 66 69 6c 6c 65 64 20 |ng to be| filled | |00003500| 62 79 20 63 61 6c 6c 73 | 20 74 6f 20 41 75 64 69 |by calls| to Audi| |00003510| 74 2e 09 0d 64 61 74 61 | 51 75 65 75 65 09 54 68 |t...data|Queue.Th| |00003520| 69 73 20 6f 70 65 72 61 | 74 69 6e 67 20 73 79 73 |is opera|ting sys| |00003530| 74 65 6d 20 71 75 65 75 | 65 20 73 74 6f 72 65 73 |tem queu|e stores| |00003540| 20 74 68 65 20 61 75 64 | 69 74 20 65 6e 74 72 69 | the aud|it entri| |00003550| 65 73 20 74 68 61 74 20 | 68 61 76 65 20 62 65 65 |es that |have bee| |00003560| 6e 20 66 69 6c 6c 65 64 | 20 61 6e 64 20 61 72 65 |n filled| and are| |00003570| 20 77 61 69 74 69 6e 67 | 20 74 6f 20 62 65 20 64 | waiting| to be d| |00003580| 69 73 70 6c 61 79 65 64 | 20 62 79 20 61 6e 20 61 |isplayed| by an a| |00003590| 70 70 6c 69 63 61 74 69 | 6f 6e 20 74 68 61 74 20 |pplicati|on that | |000035a0| 63 61 6c 6c 73 20 52 65 | 61 64 41 75 64 69 74 2e |calls Re|adAudit.| |000035b0| 09 0d 65 6e 74 72 69 65 | 73 5b 5d 09 54 68 69 73 |..entrie|s[].This| |000035c0| 20 69 73 20 61 20 76 65 | 63 74 6f 72 20 6f 66 20 | is a ve|ctor of | |000035d0| 41 75 64 69 74 51 75 65 | 75 65 45 6e 74 72 79 20 |AuditQue|ueEntry | |000035e0| 72 65 63 6f 72 64 73 20 | 74 68 61 74 20 74 68 65 |records |that the| |000035f0| 20 41 75 64 69 74 20 66 | 75 6e 63 74 69 6f 6e 20 | Audit f|unction | |00003600| 75 73 65 73 20 74 6f 20 | 73 74 6f 72 65 20 64 61 |uses to |store da| |00003610| 74 61 2e 20 41 6e 20 41 | 75 64 69 74 51 75 65 75 |ta. An A|uditQueu| |00003620| 65 45 6e 74 72 79 20 69 | 73 20 61 6e 20 41 75 64 |eEntry i|s an Aud| |00003630| 69 74 45 6e 74 72 79 20 | 70 72 65 66 61 63 65 64 |itEntry |prefaced| |00003640| 20 62 79 20 74 68 65 20 | 4f 70 65 72 61 74 69 6e | by the |Operatin| |00003650| 67 20 53 79 73 74 65 6d | 20 51 75 65 75 65 20 6c |g System| Queue l| |00003660| 69 6e 6b 61 67 65 20 70 | 6f 69 6e 74 65 72 2e 09 |inkage p|ointer..| |00003670| 0d 49 6e 69 74 41 75 64 | 69 74 20 61 6e 64 20 47 |.InitAud|it and G| |00003680| 65 74 41 75 64 69 74 50 | 74 72 20 72 65 74 75 72 |etAuditP|tr retur| |00003690| 6e 20 61 20 70 6f 69 6e | 74 65 72 20 74 6f 20 74 |n a poin|ter to t| |000036a0| 68 65 20 73 74 61 72 74 | 20 6f 66 20 74 68 65 20 |he start| of the | |000036b0| 41 75 64 69 74 52 65 63 | 6f 72 64 2e 20 46 6f 72 |AuditRec|ord. For| |000036c0| 20 72 65 66 65 72 65 6e | 63 65 2c 20 74 68 69 73 | referen|ce, this| |000036d0| 20 72 65 63 6f 72 64 20 | 69 73 20 70 72 65 63 65 | record |is prece| |000036e0| 64 65 64 20 62 79 20 61 | 20 76 65 72 79 20 73 6d |ded by a| very sm| |000036f0| 61 6c 6c 20 63 6f 64 65 | 20 73 65 67 6d 65 6e 74 |all code| segment| |00003700| 20 74 68 61 74 20 74 68 | 65 20 73 79 73 74 65 6d | that th|e system| |00003710| 20 47 65 73 74 61 6c 74 | 20 6d 61 6e 61 67 65 72 | Gestalt| manager| |00003720| 20 63 61 6c 6c 73 20 77 | 68 65 6e 20 61 6e 20 61 | calls w|hen an a| |00003730| 70 70 6c 69 63 61 74 69 | 6f 6e 20 63 61 6c 6c 73 |pplicati|on calls| |00003740| 20 47 65 73 74 61 6c 74 | 2e 20 54 68 61 74 20 63 | Gestalt|. That c| |00003750| 6f 64 65 20 73 65 67 6d | 65 6e 74 20 72 65 74 75 |ode segm|ent retu| |00003760| 72 6e 73 20 61 20 70 6f | 69 6e 74 65 72 20 74 6f |rns a po|inter to| |00003770| 20 74 68 65 20 61 75 64 | 69 74 20 72 65 63 6f 72 | the aud|it recor| |00003780| 64 2e 20 53 65 65 20 74 | 68 65 20 63 6f 6d 6d 65 |d. See t|he comme| |00003790| 6e 74 73 20 69 6e 20 41 | 75 64 69 74 2e 63 20 66 |nts in A|udit.c f| |000037a0| 6f 72 20 64 65 74 61 69 | 6c 73 2e 0d 46 55 4e 43 |or detai|ls..FUNC| |000037b0| 54 49 4f 4e 20 55 53 41 | 47 45 0d 54 68 65 20 41 |TION USA|GE.The A| |000037c0| 75 64 69 74 20 6c 69 62 | 72 61 72 79 20 63 6f 6e |udit lib|rary con| |000037d0| 74 61 69 6e 73 20 66 75 | 6e 63 74 69 6f 6e 73 20 |tains fu|nctions | |000037e0| 74 6f 20 63 72 65 61 74 | 65 20 61 75 64 69 74 20 |to creat|e audit | |000037f0| 72 65 63 6f 72 64 73 2c | 20 73 74 6f 72 65 20 64 |records,| store d| |00003800| 61 74 61 20 69 6e 20 61 | 6e 20 61 75 64 69 74 20 |ata in a|n audit | |00003810| 72 65 63 6f 72 64 2c 20 | 61 6e 64 20 65 78 74 72 |record, |and extr| |00003820| 61 63 74 20 64 61 74 61 | 20 66 72 6f 6d 20 61 6e |act data| from an| |00003830| 20 61 75 64 69 74 20 72 | 65 63 6f 72 64 2e 20 49 | audit r|ecord. I| |00003840| 6e 20 61 64 64 69 74 69 | 6f 6e 2c 20 61 20 6e 75 |n additi|on, a nu| |00003850| 6d 62 65 72 20 6f 66 20 | 66 75 6e 63 74 69 6f 6e |mber of |function| |00003860| 73 20 74 68 61 74 20 61 | 63 63 65 73 73 20 72 65 |s that a|ccess re| |00003870| 63 6f 72 64 73 20 77 69 | 74 68 69 6e 20 61 6e 20 |cords wi|thin an | |00003880| 61 75 64 69 74 20 72 65 | 63 6f 72 64 20 61 72 65 |audit re|cord are| |00003890| 20 70 72 6f 76 69 64 65 | 64 20 73 6f 20 74 68 65 | provide|d so the| |000038a0| 20 6c 69 62 72 61 72 79 | 20 63 61 6e 20 65 76 6f | library| can evo| |000038b0| 6c 76 65 20 77 69 74 68 | 6f 75 74 20 72 65 71 75 |lve with|out requ| |000038c0| 69 72 69 6e 67 20 61 70 | 70 6c 69 63 61 74 69 6f |iring ap|plicatio| |000038d0| 6e 20 70 72 6f 67 72 61 | 6d 20 6d 6f 64 69 66 69 |n progra|m modifi| |000038e0| 63 61 74 69 6f 6e 20 61 | 6e 64 2c 20 65 73 70 65 |cation a|nd, espe| |000038f0| 63 69 61 6c 6c 79 2c 20 | 73 6f 20 74 68 61 74 20 |cially, |so that | |00003900| 74 68 65 20 6c 69 62 72 | 61 72 79 20 6d 6f 64 69 |the libr|ary modi| |00003910| 66 69 65 73 20 69 74 73 | 20 69 6e 74 65 72 6e 61 |fies its| interna| |00003920| 6c 20 73 74 72 75 63 74 | 75 72 65 73 20 69 6e 20 |l struct|ures in | |00003930| 61 20 77 61 79 20 74 68 | 61 74 20 70 72 65 76 65 |a way th|at preve| |00003940| 6e 74 73 20 74 77 6f 20 | 61 73 79 63 68 72 6f 6e |nts two |asychron| |00003950| 6f 75 73 20 72 65 71 75 | 65 73 74 73 20 66 72 6f |ous requ|ests fro| |00003960| 6d 20 63 68 61 6e 67 69 | 6e 67 20 61 20 73 74 72 |m changi|ng a str| |00003970| 75 63 74 75 72 65 20 65 | 6c 65 6d 65 6e 74 20 61 |ucture e|lement a| |00003980| 74 20 74 68 65 20 73 61 | 6d 65 20 74 69 6d 65 2e |t the sa|me time.| |00003990| 0d 43 72 65 61 74 69 6e | 67 20 61 6e 20 41 75 64 |.Creatin|g an Aud| |000039a0| 69 74 20 52 65 63 6f 72 | 64 0d 41 75 64 69 74 50 |it Recor|d.AuditP| |000039b0| 74 72 0d 49 6e 69 74 41 | 75 64 69 74 28 0d 09 4f |tr.InitA|udit(..O| |000039c0| 53 54 79 70 65 09 67 65 | 73 74 61 6c 74 53 65 6c |SType.ge|staltSel| |000039d0| 65 63 74 6f 72 2c 0d 09 | 75 6e 73 69 67 6e 65 64 |ector,..|unsigned| |000039e0| 20 73 68 6f 72 74 09 6e | 45 6e 74 72 69 65 73 2c | short.n|Entries,| |000039f0| 0d 09 42 6f 6f 6c 65 61 | 6e 09 69 6e 69 74 69 61 |..Boolea|n.initia| |00003a00| 6c 6c 79 45 6e 61 62 6c | 65 64 2c 0d 09 42 6f 6f |llyEnabl|ed,..Boo| |00003a10| 6c 65 61 6e 09 70 72 65 | 73 65 72 76 65 46 69 72 |lean.pre|serveFir| |00003a20| 73 74 45 6e 74 72 69 65 | 73 0d 29 3b 0d 49 6e 69 |stEntrie|s.);.Ini| |00003a30| 74 41 75 64 69 74 20 63 | 72 65 61 74 65 73 20 61 |tAudit c|reates a| |00003a40| 20 6e 65 77 20 61 75 64 | 69 74 20 72 65 63 6f 72 | new aud|it recor| |00003a50| 64 20 61 73 20 61 20 6e | 6f 6e 2d 72 65 6c 6f 63 |d as a n|on-reloc| |00003a60| 61 74 61 62 6c 65 20 6f | 62 6a 65 63 74 20 69 6e |atable o|bject in| |00003a70| 20 74 68 65 20 53 79 73 | 74 65 6d 20 48 65 61 70 | the Sys|tem Heap| |00003a80| 20 74 68 61 74 20 69 73 | 20 d2 6e 61 6d 65 64 d3 | that is| .named.| |00003a90| 20 62 79 20 74 68 65 20 | 67 65 73 74 61 6c 74 53 | by the |gestaltS| |00003aa0| 65 6c 65 63 74 6f 72 2e | 20 54 68 65 20 72 65 63 |elector.| The rec| |00003ab0| 6f 72 64 20 77 69 6c 6c | 20 63 6f 6e 74 61 69 6e |ord will| contain| |00003ac0| 20 74 68 65 20 69 6e 64 | 69 63 61 74 65 64 20 6e | the ind|icated n| |00003ad0| 75 6d 62 65 72 20 6f 66 | 20 61 75 64 69 74 20 72 |umber of| audit r| |00003ae0| 65 63 6f 72 64 20 65 6e | 74 72 69 65 73 2e 20 54 |ecord en|tries. T| |00003af0| 68 65 20 69 6e 69 74 69 | 61 6c 6c 79 45 6e 61 62 |he initi|allyEnab| |00003b00| 6c 65 64 20 70 61 72 61 | 6d 65 74 65 72 20 61 6c |led para|meter al| |00003b10| 6c 6f 77 73 20 74 68 65 | 20 63 61 6c 6c 65 72 20 |lows the| caller | |00003b20| 63 68 6f 6f 73 65 20 77 | 68 65 74 68 65 72 20 74 |choose w|hether t| |00003b30| 6f 20 73 74 61 72 74 20 | 6c 6f 67 67 69 6e 67 20 |o start |logging | |00003b40| 77 68 65 6e 20 74 68 65 | 20 72 65 63 6f 72 64 20 |when the| record | |00003b50| 69 73 20 63 72 65 61 74 | 65 64 2e 20 49 66 20 70 |is creat|ed. If p| |00003b60| 72 65 73 65 72 76 65 46 | 69 72 73 74 45 6e 74 72 |reserveF|irstEntr| |00003b70| 69 65 73 20 69 73 20 54 | 52 55 45 2c 20 41 75 64 |ies is T|RUE, Aud| |00003b80| 69 74 20 77 69 6c 6c 20 | 6e 6f 74 20 73 74 6f 72 |it will |not stor| |00003b90| 65 20 64 61 74 61 20 69 | 66 20 74 68 65 72 65 20 |e data i|f there | |00003ba0| 61 72 65 20 6e 6f 20 65 | 6e 74 72 69 65 73 20 69 |are no e|ntries i| |00003bb0| 6e 20 74 68 65 20 66 72 | 65 65 20 71 75 65 75 65 |n the fr|ee queue| |00003bc0| 2e 20 49 66 20 70 72 65 | 73 65 72 76 65 46 69 72 |. If pre|serveFir| |00003bd0| 73 74 45 6e 74 72 69 65 | 73 20 69 73 20 46 41 4c |stEntrie|s is FAL| |00003be0| 53 45 2c 20 41 75 64 69 | 74 20 77 69 6c 6c 20 61 |SE, Audi|t will a| |00003bf0| 74 74 65 6d 70 74 20 74 | 6f 20 73 74 6f 72 65 20 |ttempt t|o store | |00003c00| 64 61 74 61 2c 20 65 76 | 65 6e 20 69 66 20 69 74 |data, ev|en if it| |00003c10| 20 68 61 73 20 74 6f 20 | 72 65 6d 6f 76 65 20 61 | has to |remove a| |00003c20| 6e 20 65 6e 74 72 79 20 | 66 72 6f 6d 20 74 68 65 |n entry |from the| |00003c30| 20 22 77 61 69 74 69 6e | 67 20 66 6f 72 20 64 69 | "waitin|g for di| |00003c40| 73 70 6c 61 79 22 20 71 | 75 65 75 65 2e 20 49 6e |splay" q|ueue. In| |00003c50| 69 74 41 75 64 69 74 20 | 72 65 74 75 72 6e 73 20 |itAudit |returns | |00003c60| 61 20 70 6f 69 6e 74 65 | 72 20 74 6f 20 74 68 65 |a pointe|r to the| |00003c70| 20 61 75 64 69 74 20 72 | 65 63 6f 72 64 20 69 74 | audit r|ecord it| |00003c80| 20 63 72 65 61 74 65 64 | 20 6f 72 20 66 6f 75 6e | created| or foun| |00003c90| 64 2c 20 6f 72 20 4e 55 | 4c 4c 20 69 66 20 69 74 |d, or NU|LL if it| |00003ca0| 20 63 61 6e 6e 6f 74 20 | 63 72 65 61 74 65 20 61 | cannot |create a| |00003cb0| 20 72 65 63 6f 72 64 2e | 0d 41 73 20 66 61 72 20 | record.|.As far | |00003cc0| 61 73 20 74 68 65 20 4d | 61 63 69 6e 74 6f 73 68 |as the M|acintosh| |00003cd0| 20 6f 70 65 72 61 74 69 | 6e 67 20 73 79 73 74 65 | operati|ng syste| |00003ce0| 6d 20 69 73 20 63 6f 6e | 63 65 72 6e 65 64 2c 20 |m is con|cerned, | |00003cf0| 61 6e 20 61 75 64 69 74 | 20 72 65 63 6f 72 64 20 |an audit| record | |00003d00| 69 73 20 61 20 47 65 73 | 74 61 6c 74 20 73 65 6c |is a Ges|talt sel| |00003d10| 65 63 74 6f 72 20 66 75 | 6e 63 74 69 6f 6e 2e 20 |ector fu|nction. | |00003d20| 54 68 69 73 20 6d 65 61 | 6e 73 20 74 68 61 74 2c |This mea|ns that,| |00003d30| 20 6f 6e 63 65 20 63 72 | 65 61 74 65 64 2c 20 69 | once cr|eated, i| |00003d40| 74 20 63 61 6e 6e 6f 74 | 20 62 65 20 64 65 6c 65 |t cannot| be dele| |00003d50| 74 65 64 20 61 6e 64 20 | 69 74 73 20 73 69 7a 65 |ted and |its size| |00003d60| 20 63 61 6e 6e 6f 74 20 | 62 65 20 63 68 61 6e 67 | cannot |be chang| |00003d70| 65 64 2e 20 57 68 65 6e | 20 63 72 65 61 74 69 6e |ed. When| creatin| |00003d80| 67 20 61 20 72 65 63 6f | 72 64 2c 20 49 6e 69 74 |g a reco|rd, Init| |00003d90| 41 75 64 69 74 20 77 69 | 6c 6c 20 63 68 65 63 6b |Audit wi|ll check| |00003da0| 20 66 6f 72 20 61 20 70 | 72 65 2d 65 78 69 73 74 | for a p|re-exist| |00003db0| 69 6e 67 20 72 65 63 6f | 72 64 2c 20 72 65 74 75 |ing reco|rd, retu| |00003dc0| 72 6e 69 6e 67 20 61 20 | 70 6f 69 6e 74 65 72 20 |rning a |pointer | |00003dd0| 74 6f 20 74 68 61 74 20 | 72 65 63 6f 72 64 20 69 |to that |record i| |00003de0| 66 20 69 74 20 65 78 69 | 73 74 73 2e 20 54 68 75 |f it exi|sts. Thu| |00003df0| 73 2c 20 79 6f 75 72 20 | 67 65 73 74 61 6c 74 53 |s, your |gestaltS| |00003e00| 65 6c 65 63 74 6f 72 20 | 6d 75 73 74 20 6e 6f 74 |elector |must not| |00003e10| 20 63 6f 6e 66 6c 69 63 | 74 20 77 69 74 68 20 61 | conflic|t with a| |00003e20| 6e 79 20 65 78 69 73 74 | 69 6e 67 20 73 65 6c 65 |ny exist|ing sele| |00003e30| 63 74 6f 72 73 2e 20 55 | 73 69 6e 67 20 79 6f 75 |ctors. U|sing you| |00003e40| 72 20 61 70 70 6c 69 63 | 61 74 69 6f 6e d5 73 20 |r applic|ation.s | |00003e50| 63 72 65 61 74 6f 72 20 | 49 44 20 6d 69 67 68 74 |creator |ID might| |00003e60| 20 62 65 20 61 70 70 72 | 6f 70 72 69 61 74 65 2e | be appr|opriate.| |00003e70| 0d 53 65 76 65 72 61 6c | 20 69 6e 64 65 70 65 6e |.Several| indepen| |00003e80| 64 65 6e 74 20 61 75 64 | 69 74 20 72 65 63 6f 72 |dent aud|it recor| |00003e90| 64 73 20 63 61 6e 20 62 | 65 20 61 63 74 69 76 65 |ds can b|e active| |00003ea0| 20 61 74 20 61 6e 79 20 | 74 69 6d 65 2c 20 73 75 | at any |time, su| |00003eb0| 62 6a 65 63 74 20 6f 6e | 6c 79 20 74 6f 20 6d 65 |bject on|ly to me| |00003ec0| 6d 6f 72 79 20 6c 69 6d | 69 74 61 74 69 6f 6e 73 |mory lim|itations| |00003ed0| 20 61 6e 64 20 67 6f 6f | 64 20 74 61 73 74 65 2e | and goo|d taste.| |00003ee0| 0d 46 69 6e 64 69 6e 67 | 20 61 6e 20 45 78 69 73 |.Finding| an Exis| |00003ef0| 74 69 6e 67 20 41 75 64 | 69 74 20 52 65 63 6f 72 |ting Aud|it Recor| |00003f00| 64 0d 41 75 64 69 74 50 | 74 72 0d 47 65 74 41 75 |d.AuditP|tr.GetAu| |00003f10| 64 69 74 50 74 72 0d 09 | 4f 53 54 79 70 65 09 67 |ditPtr..|OSType.g| |00003f20| 65 73 74 61 6c 74 53 65 | 6c 65 63 74 6f 72 0d 29 |estaltSe|lector.)| |00003f30| 3b 0d 47 65 74 41 75 64 | 69 74 50 74 72 20 72 65 |;.GetAud|itPtr re| |00003f40| 74 75 72 6e 73 20 61 20 | 70 6f 69 6e 74 65 72 20 |turns a |pointer | |00003f50| 74 6f 20 74 68 65 20 61 | 75 64 69 74 20 72 65 63 |to the a|udit rec| |00003f60| 6f 72 64 2c 20 6f 72 20 | 4e 55 4c 4c 20 69 66 20 |ord, or |NULL if | |00003f70| 6e 6f 20 72 65 63 6f 72 | 64 20 69 73 20 64 65 66 |no recor|d is def| |00003f80| 69 6e 65 64 20 66 6f 72 | 20 74 68 69 73 20 73 65 |ined for| this se| |00003f90| 6c 65 63 74 6f 72 2e 20 | 49 74 20 61 6c 73 6f 20 |lector. |It also | |00003fa0| 72 65 74 75 72 6e 73 20 | 4e 55 4c 4c 20 69 66 20 |returns |NULL if | |00003fb0| 47 65 73 74 61 6c 74 20 | 72 65 74 75 72 6e 65 64 |Gestalt |returned| |00003fc0| 20 61 20 76 61 6c 75 65 | 20 74 68 61 74 20 64 69 | a value| that di| |00003fd0| 64 20 6e 6f 74 20 73 61 | 74 69 73 66 79 20 73 65 |d not sa|tisfy se| |00003fe0| 76 65 72 61 6c 20 69 6e | 74 65 72 6e 61 6c 20 63 |veral in|ternal c| |00003ff0| 6f 6e 73 69 73 74 65 6e | 63 79 20 63 68 65 63 6b |onsisten|cy check| |00004000| 73 2e 20 54 68 69 73 20 | 6d 69 67 68 74 20 68 61 |s. This |might ha| |00004010| 70 70 65 6e 20 69 66 20 | 79 6f 75 72 20 70 72 6f |ppen if |your pro| |00004020| 67 72 61 6d 20 63 61 6c | 6c 73 20 47 65 74 41 75 |gram cal|ls GetAu| |00004030| 64 69 74 50 74 72 20 66 | 6f 72 20 61 20 73 79 73 |ditPtr f|or a sys| |00004040| 74 65 6d 20 47 65 73 74 | 61 6c 74 20 76 61 6c 75 |tem Gest|alt valu| |00004050| 65 2c 20 6f 72 20 69 66 | 20 74 68 65 72 65 20 77 |e, or if| there w| |00004060| 61 73 20 61 20 73 65 76 | 65 72 65 20 76 65 72 73 |as a sev|ere vers| |00004070| 69 6f 6e 20 6d 69 73 6d | 61 74 63 68 20 62 65 74 |ion mism|atch bet| |00004080| 77 65 65 6e 20 74 68 65 | 20 6c 69 62 72 61 72 79 |ween the| library| |00004090| 20 74 68 61 74 20 63 72 | 65 61 74 65 64 20 74 68 | that cr|eated th| |000040a0| 65 20 61 75 64 69 74 20 | 72 65 63 6f 72 64 20 61 |e audit |record a| |000040b0| 6e 64 20 74 68 65 20 6c | 69 62 72 61 72 79 20 74 |nd the l|ibrary t| |000040c0| 68 61 74 20 69 73 20 61 | 74 74 65 6d 70 74 69 6e |hat is a|ttemptin| |000040d0| 67 20 74 6f 20 61 63 63 | 65 73 73 20 69 74 2e 0d |g to acc|ess it..| |000040e0| 59 6f 75 72 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |Your app|lication| |000040f0| 20 77 6f 75 6c 64 20 74 | 79 70 69 63 61 6c 6c 79 | would t|ypically| |00004100| 20 63 61 6c 6c 20 74 68 | 69 73 20 66 75 6e 63 74 | call th|is funct| |00004110| 69 6f 6e 20 77 68 65 6e | 20 69 74 20 73 74 61 72 |ion when| it star| |00004120| 74 73 20 73 69 6e 63 65 | 2c 20 69 66 20 61 6e 20 |ts since|, if an | |00004130| 61 75 64 69 74 20 72 65 | 63 6f 72 64 20 69 73 20 |audit re|cord is | |00004140| 70 72 65 73 65 6e 74 2c | 20 69 74 20 77 69 6c 6c |present,| it will| |00004150| 20 72 65 6d 61 69 6e 20 | 75 6e 74 69 6c 20 79 6f | remain |until yo| |00004160| 75 72 20 73 79 73 74 65 | 6d 20 69 73 20 73 68 75 |ur syste|m is shu| |00004170| 74 64 6f 77 6e 20 6f 72 | 20 72 65 73 74 61 72 74 |tdown or| restart| |00004180| 65 64 2e 20 54 68 65 20 | 76 61 6c 75 65 20 72 65 |ed. The |value re| |00004190| 74 75 72 6e 65 64 20 62 | 79 20 47 65 74 41 75 64 |turned b|y GetAud| |000041a0| 69 74 50 74 72 20 69 73 | 20 75 73 65 64 20 61 73 |itPtr is| used as| |000041b0| 20 61 20 70 61 72 61 6d | 65 74 65 72 20 74 6f 20 | a param|eter to | |000041c0| 61 6c 6c 20 6f 74 68 65 | 72 20 66 75 6e 63 74 69 |all othe|r functi| |000041d0| 6f 6e 73 2e 20 41 6c 74 | 68 6f 75 67 68 20 79 6f |ons. Alt|hough yo| |000041e0| 75 72 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 20 63 |ur appli|cation c| |000041f0| 6f 75 6c 64 20 63 61 6c | 6c 20 47 65 74 41 75 64 |ould cal|l GetAud| |00004200| 69 74 50 74 72 20 65 61 | 63 68 20 74 69 6d 65 20 |itPtr ea|ch time | |00004210| 69 74 20 74 72 69 65 73 | 20 74 6f 20 6c 6f 67 20 |it tries| to log | |00004220| 73 6f 6d 65 20 64 61 74 | 61 2c 20 74 68 69 73 20 |some dat|a, this | |00004230| 72 65 71 75 69 72 65 73 | 20 61 6e 20 69 6e 74 65 |requires| an inte| |00004240| 72 6e 61 6c 20 63 61 6c | 6c 20 74 6f 20 47 65 73 |rnal cal|l to Ges| |00004250| 74 61 6c 74 20 77 68 69 | 63 68 20 77 6f 75 6c 64 |talt whi|ch would| |00004260| 20 62 65 20 69 6e 65 66 | 66 69 63 69 65 6e 74 2e | be inef|ficient.| |00004270| 0d 57 72 69 74 69 6e 67 | 20 61 6e 20 41 75 64 69 |.Writing| an Audi| |00004280| 74 20 52 65 63 6f 72 64 | 20 45 6e 74 72 79 0d 76 |t Record| Entry.v| |00004290| 6f 69 64 0d 41 75 64 69 | 74 28 0d 09 41 75 64 69 |oid.Audi|t(..Audi| |000042a0| 74 50 74 72 09 61 75 64 | 69 74 50 74 72 2c 0d 09 |tPtr.aud|itPtr,..| |000042b0| 4f 53 54 79 70 65 09 69 | 64 43 6f 64 65 2c 0d 09 |OSType.i|dCode,..| |000042c0| 75 6e 73 69 67 6e 65 64 | 20 6c 6f 6e 67 09 66 6f |unsigned| long.fo| |000042d0| 72 6d 61 74 2c 0d 09 2e | 2e 2e 09 2f 2a 20 41 64 |rmat,...|.../* Ad| |000042e0| 64 69 74 69 6f 6e 61 6c | 20 70 61 72 61 6d 65 74 |ditional| paramet| |000042f0| 65 72 73 2c 20 69 66 20 | 61 6e 79 20 2a 2f 0d 29 |ers, if |any */.)| |00004300| 3b 0d 54 68 65 20 41 75 | 64 69 74 20 66 75 6e 63 |;.The Au|dit func| |00004310| 74 69 6f 6e 20 73 74 6f | 72 65 73 20 61 6e 20 65 |tion sto|res an e| |00004320| 6e 74 72 79 20 69 6e 20 | 74 68 65 20 61 75 64 69 |ntry in |the audi| |00004330| 74 20 72 65 63 6f 72 64 | 20 74 68 61 74 20 63 6f |t record| that co| |00004340| 6e 74 61 69 6e 73 20 74 | 68 65 20 66 6f 6c 6c 6f |ntains t|he follo| |00004350| 77 69 6e 67 20 64 61 74 | 61 3a 0d a5 09 41 75 64 |wing dat|a:...Aud| |00004360| 69 74 20 74 69 6d 65 73 | 74 61 6d 70 73 20 65 61 |it times|tamps ea| |00004370| 63 68 20 65 6e 74 72 79 | 20 77 69 74 68 20 74 68 |ch entry| with th| |00004380| 65 20 73 79 73 74 65 6d | 20 54 69 63 6b 73 28 29 |e system| Ticks()| |00004390| 20 76 61 6c 75 65 2e 20 | 41 73 20 77 69 6c 6c 20 | value. |As will | |000043a0| 62 65 20 73 65 65 6e 2c | 20 79 6f 75 72 20 64 69 |be seen,| your di| |000043b0| 73 70 6c 61 79 20 70 72 | 6f 63 65 64 75 72 65 20 |splay pr|ocedure | |000043c0| 63 61 6e 20 63 6f 6e 76 | 65 72 74 20 74 68 69 73 |can conv|ert this| |000043d0| 20 76 61 6c 75 65 20 69 | 6e 74 6f 20 63 69 76 69 | value i|nto civi| |000043e0| 6c 20 74 69 6d 65 20 28 | 68 6f 75 72 73 2c 20 6d |l time (|hours, m| |000043f0| 69 6e 75 74 65 73 2c 20 | 73 65 63 6f 6e 64 73 29 |inutes, |seconds)| |00004400| 20 77 68 65 6e 20 74 68 | 65 20 65 6e 74 72 79 20 | when th|e entry | |00004410| 69 73 20 64 69 73 70 6c | 61 79 65 64 2e 0d a5 09 |is displ|ayed....| |00004420| 69 64 43 6f 64 65 20 69 | 73 20 61 20 76 61 6c 75 |idCode i|s a valu| |00004430| 65 20 74 68 61 74 20 79 | 6f 75 20 73 70 65 63 69 |e that y|ou speci| |00004440| 66 79 2e 20 42 79 20 63 | 6f 6e 76 65 6e 74 69 6f |fy. By c|onventio| |00004450| 6e 2c 20 69 74 20 69 73 | 20 61 73 73 75 6d 65 64 |n, it is| assumed| |00004460| 20 74 6f 20 62 65 20 61 | 6e 20 4f 53 54 79 70 65 | to be a|n OSType| |00004470| 20 74 68 61 74 20 74 68 | 65 20 64 69 73 70 6c 61 | that th|e displa| |00004480| 79 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 20 75 73 |y applic|ation us| |00004490| 65 73 20 74 6f 20 69 64 | 65 6e 74 69 66 79 20 74 |es to id|entify t| |000044a0| 68 65 20 61 75 64 69 74 | 20 72 65 71 75 65 73 74 |he audit| request| |000044b0| 2e 20 54 68 69 73 20 6d | 61 79 20 62 65 20 61 20 |. This m|ay be a | |000044c0| 75 6e 69 71 75 65 20 76 | 61 6c 75 65 20 66 6f 72 |unique v|alue for| |000044d0| 20 65 61 63 68 20 72 65 | 71 75 65 73 74 20 6f 72 | each re|quest or| |000044e0| 20 61 20 76 61 6c 75 65 | 20 74 68 61 74 20 69 73 | a value| that is| |000044f0| 20 63 6f 6d 6d 6f 6e 20 | 74 6f 20 61 20 67 72 6f | common |to a gro| |00004500| 75 70 20 6f 66 20 72 65 | 71 75 65 73 74 73 20 28 |up of re|quests (| |00004510| 73 75 63 68 20 61 73 20 | 61 20 73 69 6e 67 6c 65 |such as |a single| |00004520| 20 66 75 6e 63 74 69 6f | 6e 20 6f 72 20 66 75 6e | functio|n or fun| |00004530| 63 74 69 6f 6e 20 6c 69 | 62 72 61 72 79 29 2e 20 |ction li|brary). | |00004540| 41 75 64 69 74 20 64 6f | 65 73 20 6e 6f 74 20 69 |Audit do|es not i| |00004550| 6e 74 65 72 70 72 65 74 | 20 74 68 69 73 20 76 61 |nterpret| this va| |00004560| 6c 75 65 2c 20 68 6f 77 | 65 76 65 72 20 74 68 65 |lue, how|ever the| |00004570| 20 4d 61 63 73 42 75 67 | 20 64 69 73 70 6c 61 79 | MacsBug| display| |00004580| 20 72 6f 75 74 69 6e 65 | 20 28 64 63 6d 64 29 20 | routine| (dcmd) | |00004590| 69 6e 74 65 72 70 72 65 | 74 65 73 20 69 74 20 61 |interpre|tes it a| |000045a0| 73 20 61 6e 20 4f 53 54 | 79 70 65 2e 20 4e 6f 74 |s an OST|ype. Not| |000045b0| 65 20 74 68 61 74 2c 20 | 6f 6e 20 74 68 65 20 4d |e that, |on the M| |000045c0| 61 63 69 6e 74 6f 73 68 | 2c 20 61 6e 20 4f 53 54 |acintosh|, an OST| |000045d0| 79 70 65 20 63 61 6e 20 | 62 65 20 63 6f 65 72 63 |ype can |be coerc| |000045e0| 65 64 20 74 6f 20 61 6e | 79 20 6c 6f 6e 67 77 6f |ed to an|y longwo| |000045f0| 72 64 20 73 63 61 6c 61 | 72 2c 20 73 75 63 68 20 |rd scala|r, such | |00004600| 61 73 20 61 20 6d 65 6d | 6f 72 79 20 61 64 64 72 |as a mem|ory addr| |00004610| 65 73 73 2e 20 41 73 20 | 79 6f 75 20 61 64 61 70 |ess. As |you adap| |00004620| 74 20 74 68 65 20 41 75 | 64 69 74 20 6c 69 62 72 |t the Au|dit libr| |00004630| 61 72 79 20 74 6f 20 79 | 6f 75 72 20 6f 77 6e 20 |ary to y|our own | |00004640| 75 73 65 2c 20 79 6f 75 | 20 6d 61 79 20 77 69 73 |use, you| may wis| |00004650| 68 20 74 6f 20 63 6f 6e | 73 69 64 65 72 20 70 61 |h to con|sider pa| |00004660| 73 73 69 6e 67 20 73 6f | 6d 65 20 73 74 61 74 65 |ssing so|me state| |00004670| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 20 69 6e 20 | informa|tion in | |00004680| 74 68 65 20 69 64 43 6f | 64 65 20 70 61 72 61 6d |the idCo|de param| |00004690| 65 74 65 72 20 28 70 65 | 72 68 61 70 73 20 61 20 |eter (pe|rhaps a | |000046a0| 70 6f 69 6e 74 65 72 20 | 74 6f 20 61 20 74 61 73 |pointer |to a tas| |000046b0| 6b 2d 73 70 65 63 69 66 | 69 63 20 68 61 6e 64 6c |k-specif|ic handl| |000046c0| 65 29 20 72 61 74 68 65 | 72 20 74 68 61 6e 20 75 |e) rathe|r than u| |000046d0| 73 69 6e 67 20 69 74 20 | 61 73 20 61 20 68 75 6d |sing it |as a hum| |000046e0| 61 6e 2d 72 65 61 64 61 | 62 6c 65 20 69 64 65 6e |an-reada|ble iden| |000046f0| 74 69 66 69 65 72 2e 0d | a5 09 66 6f 72 6d 61 74 |tifier..|..format| |00004700| 20 69 73 20 61 20 33 32 | 2d 62 69 74 20 76 61 6c | is a 32|-bit val| |00004710| 75 65 20 74 68 61 74 20 | 74 68 65 20 41 75 64 69 |ue that |the Audi| |00004720| 74 20 66 75 6e 63 74 69 | 6f 6e 20 69 6e 74 65 72 |t functi|on inter| |00004730| 70 72 65 74 73 20 74 6f | 20 75 6e 64 65 72 73 74 |prets to| underst| |00004740| 61 6e 64 20 68 6f 77 20 | 74 6f 20 70 72 6f 63 65 |and how |to proce| |00004750| 73 73 20 74 68 65 20 61 | 64 64 69 74 69 6f 6e 61 |ss the a|dditiona| |00004760| 6c 20 70 61 72 61 6d 65 | 74 65 72 73 2c 20 69 66 |l parame|ters, if| |00004770| 20 61 6e 79 2e 20 49 74 | 20 73 68 6f 75 6c 64 20 | any. It| should | |00004780| 62 65 20 73 65 74 20 74 | 6f 20 74 68 65 20 72 65 |be set t|o the re| |00004790| 73 75 6c 74 20 6f 66 20 | 65 78 70 61 6e 64 69 6e |sult of |expandin| |000047a0| 67 20 74 68 65 20 41 75 | 64 69 74 46 6f 72 6d 61 |g the Au|ditForma| |000047b0| 74 20 6d 61 63 72 6f 2c | 20 6f 72 20 6f 6e 65 20 |t macro,| or one | |000047c0| 6f 66 20 74 77 6f 20 73 | 70 65 63 69 61 6c 20 76 |of two s|pecial v| |000047d0| 61 6c 75 65 73 2e 20 49 | 74 20 77 69 6c 6c 20 62 |alues. I|t will b| |000047e0| 65 20 64 65 73 63 72 69 | 62 65 64 20 62 65 6c 6f |e descri|bed belo| |000047f0| 77 2e 0d a5 09 59 6f 75 | 72 20 70 72 6f 67 72 61 |w....You|r progra| |00004800| 6d 20 75 70 20 74 6f 20 | 65 69 67 68 74 20 6c 6f |m up to |eight lo| |00004810| 6e 67 77 6f 72 64 20 61 | 72 67 75 6d 65 6e 74 73 |ngword a|rguments| |00004820| 2e 20 54 68 65 20 66 6f | 72 6d 61 74 20 70 61 72 |. The fo|rmat par| |00004830| 61 6d 65 74 65 72 20 74 | 65 6c 6c 73 20 41 75 64 |ameter t|ells Aud| |00004840| 69 74 20 61 6e 64 20 74 | 68 65 20 64 69 73 70 6c |it and t|he displ| |00004850| 61 79 20 70 72 6f 63 65 | 64 75 72 65 20 68 6f 77 |ay proce|dure how| |00004860| 20 74 6f 20 69 6e 74 65 | 72 70 72 65 74 20 74 68 | to inte|rpret th| |00004870| 65 73 65 20 61 72 67 75 | 6d 65 6e 74 73 2c 20 69 |ese argu|ments, i| |00004880| 66 20 61 6e 79 2e 0d 4e | 6f 74 65 3a 20 62 65 63 |f any..N|ote: bec| |00004890| 61 75 73 65 20 6f 66 20 | 64 69 66 66 65 72 65 6e |ause of |differen| |000048a0| 63 65 73 20 62 65 74 77 | 65 65 6e 20 76 61 72 69 |ces betw|een vari| |000048b0| 6f 75 73 20 43 20 63 6f | 6d 70 69 6c 65 72 73 2c |ous C co|mpilers,| |000048c0| 20 69 74 20 69 73 20 65 | 73 73 65 6e 74 69 61 6c | it is e|ssential| |000048d0| 20 74 68 61 74 20 79 6f | 75 72 20 70 72 6f 67 72 | that yo|ur progr| |000048e0| 61 6d 20 73 70 65 63 69 | 66 79 20 61 6c 6c 20 64 |am speci|fy all d| |000048f0| 61 74 61 20 70 61 72 61 | 6d 65 74 65 72 73 20 61 |ata para|meters a| |00004900| 73 20 6c 6f 6e 67 77 6f | 72 64 73 2e 20 46 6f 72 |s longwo|rds. For| |00004910| 20 65 78 61 6d 70 6c 65 | 2c 20 69 66 20 79 6f 75 | example|, if you| |00004920| 20 77 69 73 68 20 74 6f | 20 6c 6f 67 20 61 20 76 | wish to| log a v| |00004930| 61 6c 75 65 20 74 68 61 | 74 20 69 73 20 6e 6f 72 |alue tha|t is nor| |00004940| 6d 61 6c 6c 79 20 73 74 | 6f 72 65 64 20 61 73 20 |mally st|ored as | |00004950| 61 20 73 68 6f 72 74 20 | 76 61 6c 75 65 2c 20 73 |a short |value, s| |00004960| 75 63 68 20 61 73 20 61 | 20 73 79 73 74 65 6d 20 |uch as a| system | |00004970| 65 72 72 6f 72 20 63 6f | 64 65 20 6f 72 20 42 6f |error co|de or Bo| |00004980| 6f 6c 65 61 6e 2c 20 79 | 6f 75 72 20 70 72 6f 67 |olean, y|our prog| |00004990| 72 61 6d 20 6d 75 73 74 | 20 65 78 70 6c 69 63 69 |ram must| explici| |000049a0| 74 6c 79 20 63 61 73 74 | 20 69 74 20 74 6f 20 6c |tly cast| it to l| |000049b0| 6f 6e 67 20 6f 72 20 75 | 6e 73 69 67 6e 65 64 20 |ong or u|nsigned | |000049c0| 6c 6f 6e 67 2e 20 49 66 | 20 79 6f 75 20 64 6f 6e |long. If| you don| |000049d0| d5 74 20 64 6f 20 74 68 | 69 73 2c 20 79 6f 75 20 |.t do th|is, you | |000049e0| 77 69 6c 6c 20 64 69 73 | 70 6c 61 79 20 69 6e 63 |will dis|play inc| |000049f0| 6f 72 72 65 63 74 20 64 | 61 74 61 2e 20 54 68 65 |orrect d|ata. The| |00004a00| 20 41 75 64 69 74 20 6c | 69 62 72 61 72 79 20 6f | Audit l|ibrary o| |00004a10| 70 65 72 61 74 65 73 20 | 63 6f 6d 70 61 74 69 62 |perates |compatib| |00004a20| 6c 79 20 75 6e 64 65 72 | 20 62 6f 74 68 20 4d 50 |ly under| both MP| |00004a30| 57 20 61 6e 64 20 54 68 | 69 6e 6b 20 43 2e 20 41 |W and Th|ink C. A| |00004a40| 6e 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 20 77 72 |n applic|ation wr| |00004a50| 69 74 74 65 6e 20 69 6e | 20 6f 6e 65 20 65 6e 76 |itten in| one env| |00004a60| 69 72 6f 6e 6d 65 6e 74 | 20 63 61 6e 20 61 63 63 |ironment| can acc| |00004a70| 65 73 73 20 61 6e 20 41 | 75 64 69 74 20 52 65 63 |ess an A|udit Rec| |00004a80| 6f 72 64 20 63 72 65 61 | 74 65 64 20 62 79 20 74 |ord crea|ted by t| |00004a90| 68 65 20 6f 74 68 65 72 | 20 65 6e 76 69 72 6f 6e |he other| environ| |00004aa0| 6d 65 6e 74 2e 0d 4f 66 | 20 63 6f 75 72 73 65 2c |ment..Of| course,| |00004ab0| 20 41 75 64 69 74 20 77 | 69 6c 6c 20 6f 6e 6c 79 | Audit w|ill only| |00004ac0| 20 73 74 6f 72 65 20 61 | 6e 20 65 6e 74 72 79 20 | store a|n entry | |00004ad0| 69 66 20 73 65 76 65 72 | 61 6c 20 63 6f 6e 64 69 |if sever|al condi| |00004ae0| 74 69 6f 6e 73 20 61 72 | 65 20 6d 65 74 3a 0d a5 |tions ar|e met:..| |00004af0| 09 41 75 64 69 74 50 74 | 72 20 6d 75 73 74 20 62 |.AuditPt|r must b| |00004b00| 65 20 6e 6f 6e 2d 4e 55 | 4c 4c 2e 20 49 74 20 69 |e non-NU|LL. It i| |00004b10| 73 20 74 68 65 20 76 61 | 6c 75 65 20 72 65 74 75 |s the va|lue retu| |00004b20| 72 6e 65 64 20 62 79 20 | 47 65 74 41 75 64 69 74 |rned by |GetAudit| |00004b30| 50 74 72 20 6f 72 20 49 | 6e 69 74 41 75 64 69 74 |Ptr or I|nitAudit| |00004b40| 2e 20 49 66 20 69 74 20 | 69 73 20 4e 55 4c 4c 2c |. If it |is NULL,| |00004b50| 20 41 75 64 69 74 20 73 | 69 6c 65 6e 74 6c 79 20 | Audit s|ilently | |00004b60| 72 65 74 75 72 6e 73 2e | 0d a5 09 54 68 65 20 76 |returns.|...The v| |00004b70| 65 72 73 69 6f 6e 20 6e | 75 6d 62 65 72 20 61 6e |ersion n|umber an| |00004b80| 64 20 72 65 63 6f 72 64 | 20 73 69 7a 65 20 76 61 |d record| size va| |00004b90| 6c 75 65 73 20 6d 75 73 | 74 20 62 65 20 61 63 63 |lues mus|t be acc| |00004ba0| 65 70 74 61 62 6c 65 2e | 0d a5 09 41 75 64 69 74 |eptable.|...Audit| |00004bb0| 69 6e 67 20 6d 75 73 74 | 20 68 61 76 65 20 62 65 |ing must| have be| |00004bc0| 65 6e 20 65 6e 61 62 6c | 65 64 2c 20 65 69 74 68 |en enabl|ed, eith| |00004bd0| 65 72 20 62 79 20 49 6e | 69 74 41 75 64 69 74 20 |er by In|itAudit | |00004be0| 6f 72 20 45 6e 61 62 6c | 65 41 75 64 69 74 2e 0d |or Enabl|eAudit..| |00004bf0| a5 09 54 68 65 72 65 20 | 6d 75 73 74 20 62 65 20 |..There |must be | |00004c00| 72 6f 6f 6d 20 66 6f 72 | 20 74 68 65 20 65 6e 74 |room for| the ent| |00004c10| 72 79 20 69 6e 20 74 68 | 65 20 61 75 64 69 74 20 |ry in th|e audit | |00004c20| 65 6e 74 72 79 20 61 72 | 65 61 2e 20 54 68 69 73 |entry ar|ea. This| |00004c30| 20 74 65 73 74 20 77 69 | 6c 6c 20 66 61 69 6c 20 | test wi|ll fail | |00004c40| 69 66 20 79 6f 75 72 20 | 64 69 73 70 6c 61 79 20 |if your |display | |00004c50| 66 75 6e 63 74 69 6f 6e | 20 64 6f 65 73 20 6e 6f |function| does no| |00004c60| 74 20 72 65 61 64 20 61 | 75 64 69 74 20 72 65 63 |t read a|udit rec| |00004c70| 6f 72 64 20 65 6e 74 72 | 69 65 73 20 71 75 69 63 |ord entr|ies quic| |00004c80| 6b 6c 79 20 65 6e 6f 75 | 67 68 20 61 6e 64 20 77 |kly enou|gh and w| |00004c90| 69 6c 6c 20 62 65 20 64 | 69 73 63 75 73 73 65 64 |ill be d|iscussed| |00004ca0| 20 66 75 72 74 68 65 72 | 2e 0d 46 6f 72 6d 61 74 | further|..Format| |00004cb0| 74 69 6e 67 20 41 75 64 | 69 74 20 70 61 72 61 6d |ting Aud|it param| |00004cc0| 65 74 65 72 73 0d 49 6e | 20 6f 72 64 65 72 20 74 |eters.In| order t| |00004cd0| 6f 20 73 69 6d 70 6c 69 | 66 79 20 61 75 64 69 74 |o simpli|fy audit| |00004ce0| 20 64 69 73 70 6c 61 79 | 20 61 70 70 6c 69 63 61 | display| applica| |00004cf0| 74 69 6f 6e 73 2c 20 65 | 61 63 68 20 61 75 64 69 |tions, e|ach audi| |00004d00| 74 20 72 65 63 6f 72 64 | 20 65 6e 74 72 79 20 69 |t record| entry i| |00004d10| 73 20 73 65 6c 66 2d 66 | 6f 72 6d 61 74 74 69 6e |s self-f|ormattin| |00004d20| 67 2e 20 54 68 65 20 66 | 6f 72 6d 61 74 20 70 61 |g. The f|ormat pa| |00004d30| 72 61 6d 65 74 65 72 20 | 73 70 65 63 69 66 69 65 |rameter |specifie| |00004d40| 73 20 74 68 65 20 66 6f | 72 6d 61 74 20 6f 66 20 |s the fo|rmat of | |00004d50| 61 6c 6c 20 61 64 64 69 | 74 69 6f 6e 61 6c 20 70 |all addi|tional p| |00004d60| 61 72 61 6d 65 74 65 72 | 73 2e 20 54 68 65 20 66 |arameter|s. The f| |00004d70| 6f 72 6d 61 74 20 70 61 | 72 61 6d 65 74 65 72 20 |ormat pa|rameter | |00004d80| 73 68 6f 75 6c 64 20 62 | 65 20 63 6f 6e 73 74 72 |should b|e constr| |00004d90| 75 63 74 65 64 20 62 79 | 20 65 78 70 61 6e 64 69 |ucted by| expandi| |00004da0| 6e 67 20 74 68 65 20 41 | 75 64 69 74 46 6f 72 6d |ng the A|uditForm| |00004db0| 61 74 20 6d 61 63 72 6f | 2e 20 46 6f 72 20 6d 6f |at macro|. For mo| |00004dc0| 73 74 20 75 73 65 73 2c | 20 79 6f 75 20 77 6f 75 |st uses,| you wou| |00004dd0| 6c 64 20 75 73 65 20 41 | 75 64 69 74 46 6f 72 6d |ld use A|uditForm| |00004de0| 61 74 31 2c 20 41 75 64 | 69 74 46 6f 72 6d 61 74 |at1, Aud|itFormat| |00004df0| 32 2c 20 65 74 63 2e 20 | 77 68 69 63 68 20 63 61 |2, etc. |which ca| |00004e00| 6c 6c 20 41 75 64 69 74 | 46 6f 72 6d 61 74 20 77 |ll Audit|Format w| |00004e10| 69 74 68 20 74 68 65 20 | 70 72 6f 70 65 72 20 61 |ith the |proper a| |00004e20| 72 67 75 6d 65 6e 74 20 | 73 65 71 75 65 6e 63 65 |rgument |sequence| |00004e30| 2e 0d 54 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 2c |..The fo|llowing,| |00004e40| 20 69 66 20 70 72 65 73 | 65 6e 74 2c 20 6d 75 73 | if pres|ent, mus| |00004e50| 74 20 62 65 20 74 68 65 | 20 6c 61 73 74 20 d1 20 |t be the| last . | |00004e60| 6f 72 20 6f 6e 6c 79 20 | d1 20 41 75 64 69 74 46 |or only |. AuditF| |00004e70| 6f 72 6d 61 74 20 61 72 | 67 75 6d 65 6e 74 20 73 |ormat ar|gument s| |00004e80| 70 65 63 69 66 69 63 61 | 74 69 6f 6e 3a 0d 6b 41 |pecifica|tion:.kA| |00004e90| 75 64 69 74 46 6f 72 6d | 61 74 53 74 72 69 6e 67 |uditForm|atString| |00004ea0| 09 54 68 69 73 20 6d 75 | 73 74 20 62 65 20 74 68 |.This mu|st be th| |00004eb0| 65 20 6c 61 73 74 20 70 | 61 72 61 6d 65 74 65 72 |e last p|arameter| |00004ec0| 20 69 6e 20 61 6e 20 41 | 75 64 69 74 46 6f 72 6d | in an A|uditForm| |00004ed0| 61 74 20 73 70 65 63 69 | 66 69 63 61 74 69 6f 6e |at speci|fication| |00004ee0| 2e 20 41 75 64 69 74 20 | 72 65 71 75 69 72 65 73 |. Audit |requires| |00004ef0| 20 6f 6e 65 20 61 64 64 | 69 74 69 6f 6e 61 6c 20 | one add|itional | |00004f00| 70 61 72 61 6d 65 74 65 | 72 2c 20 61 20 50 61 73 |paramete|r, a Pas| |00004f10| 63 61 6c 20 73 74 72 69 | 6e 67 2e 20 49 66 20 69 |cal stri|ng. If i| |00004f20| 74 20 69 73 20 74 68 65 | 20 6f 6e 6c 79 20 70 61 |t is the| only pa| |00004f30| 72 61 6d 65 74 65 72 2c | 20 74 68 65 20 66 69 72 |rameter,| the fir| |00004f40| 73 74 20 33 31 20 62 79 | 74 65 73 20 6f 66 20 74 |st 31 by|tes of t| |00004f50| 68 65 20 73 74 72 69 6e | 67 20 77 69 6c 6c 20 62 |he strin|g will b| |00004f60| 65 20 73 74 6f 72 65 64 | 2e 20 49 66 20 6f 74 68 |e stored|. If oth| |00004f70| 65 72 20 70 61 72 61 6d | 65 74 65 72 73 20 70 72 |er param|eters pr| |00004f80| 65 63 65 65 64 20 74 68 | 69 73 2c 20 61 73 20 6d |eceed th|is, as m| |00004f90| 61 6e 79 20 62 79 74 65 | 73 20 61 73 20 63 61 6e |any byte|s as can| |00004fa0| 20 66 69 74 20 77 69 6c | 6c 20 62 65 20 73 74 6f | fit wil|l be sto| |00004fb0| 72 65 64 20 28 65 61 63 | 68 20 61 72 67 75 6d 65 |red (eac|h argume| |00004fc0| 6e 74 20 72 65 71 75 69 | 72 65 73 20 66 6f 75 72 |nt requi|res four| |00004fd0| 20 62 79 74 65 73 29 2e | 20 59 6f 75 72 20 70 72 | bytes).| Your pr| |00004fe0| 6f 67 72 61 6d 20 64 6f | 65 73 20 6e 6f 74 20 6e |ogram do|es not n| |00004ff0| 65 65 64 20 74 6f 20 63 | 6f 6e 63 65 72 6e 20 69 |eed to c|oncern i| |00005000| 74 73 65 6c 66 20 77 69 | 74 68 20 73 74 72 69 6e |tself wi|th strin| |00005010| 67 20 6c 65 6e 67 74 68 | 3b 20 74 68 65 20 41 75 |g length|; the Au| |00005020| 64 69 74 20 66 75 6e 63 | 74 69 6f 6e 20 74 72 75 |dit func|tion tru| |00005030| 6e 63 61 74 65 73 20 74 | 68 65 20 64 61 74 61 20 |ncates t|he data | |00005040| 61 73 20 6e 65 65 64 65 | 64 2e 20 4e 6f 74 65 3a |as neede|d. Note:| |00005050| 20 69 66 20 74 68 65 20 | 70 61 72 61 6d 65 74 65 | if the |paramete| |00005060| 72 20 69 73 20 62 61 64 | 20 28 4e 55 4c 4c 20 6f |r is bad| (NULL o| |00005070| 72 20 67 72 65 61 74 65 | 72 20 74 68 61 6e 20 74 |r greate|r than t| |00005080| 68 65 20 6c 6f 67 69 63 | 61 6c 20 52 41 4d 20 73 |he logic|al RAM s| |00005090| 69 7a 65 2c 20 69 74 20 | 77 69 6c 6c 20 64 69 73 |ize, it |will dis| |000050a0| 70 6c 61 79 20 d2 3f 4e | 4e d3 20 77 68 65 72 65 |play .?N|N. where| |000050b0| 20 4e 4e 20 69 73 20 74 | 68 65 20 76 61 6c 75 65 | NN is t|he value| |000050c0| 20 6f 66 20 74 68 65 20 | 61 72 67 75 6d 65 6e 74 | of the |argument| |000050d0| 20 69 6e 20 48 65 78 09 | 0d 6b 41 75 64 69 74 46 | in Hex.|.kAuditF| |000050e0| 6f 72 6d 61 74 53 74 61 | 74 75 73 4c 6f 63 61 74 |ormatSta|tusLocat| |000050f0| 69 6f 6e 09 54 68 69 73 | 20 6d 75 73 74 20 62 65 |ion.This| must be| |00005100| 20 74 68 65 20 6c 61 73 | 74 20 70 61 72 61 6d 65 | the las|t parame| |00005110| 74 65 72 20 69 6e 20 61 | 6e 20 41 75 64 69 74 46 |ter in a|n AuditF| |00005120| 6f 72 6d 61 74 20 73 70 | 65 63 69 66 69 63 61 74 |ormat sp|ecificat| |00005130| 69 6f 6e 2e 20 54 68 65 | 72 65 20 69 73 20 6e 6f |ion. The|re is no| |00005140| 20 61 73 73 6f 63 69 61 | 74 65 64 20 70 61 72 61 | associa|ted para| |00005150| 6d 65 74 65 72 2e 20 54 | 68 65 20 41 75 64 69 74 |meter. T|he Audit| |00005160| 20 66 75 6e 63 74 69 6f | 6e 20 73 74 6f 72 65 73 | functio|n stores| |00005170| 20 74 68 65 20 6e 61 6d | 65 20 61 6e 64 20 6f 66 | the nam|e and of| |00005180| 66 73 65 74 20 6f 66 20 | 74 68 65 20 63 61 6c 6c |fset of |the call| |00005190| 65 72 20 69 6e 20 74 68 | 65 20 61 75 64 69 74 20 |er in th|e audit | |000051a0| 72 65 63 6f 72 64 2c 20 | 74 72 75 6e 63 61 74 69 |record, |truncati| |000051b0| 6e 67 20 74 68 65 20 73 | 74 72 69 6e 67 20 61 73 |ng the s|tring as| |000051c0| 20 6e 65 65 64 65 64 2e | 09 0d 54 68 65 20 66 6f | needed.|..The fo| |000051d0| 6c 6c 6f 77 69 6e 67 20 | 6d 61 79 20 61 70 70 65 |llowing |may appe| |000051e0| 61 72 20 61 6e 79 77 68 | 65 72 65 20 69 6e 20 74 |ar anywh|ere in t| |000051f0| 68 65 20 41 75 64 69 74 | 46 6f 72 6d 61 74 20 6f |he Audit|Format o| |00005200| 70 65 72 61 74 69 6f 6e | 2e 20 45 61 63 68 20 61 |peration|. Each a| |00005210| 72 67 75 6d 65 6e 74 20 | 64 65 66 69 6e 65 73 20 |rgument |defines | |00005220| 74 68 65 20 66 6f 72 6d | 61 74 20 6f 66 20 61 6e |the form|at of an| |00005230| 20 61 73 73 6f 63 69 61 | 74 65 64 20 41 75 64 69 | associa|ted Audi| |00005240| 74 20 70 61 72 61 6d 65 | 74 65 72 3a 0d 6b 41 75 |t parame|ter:.kAu| |00005250| 64 69 74 46 6f 72 6d 61 | 74 53 69 67 6e 65 64 09 |ditForma|tSigned.| |00005260| 41 20 73 69 67 6e 65 64 | 20 69 6e 74 65 67 65 72 |A signed| integer| |00005270| 20 6c 6f 6e 67 77 6f 72 | 64 20 76 61 6c 75 65 2e | longwor|d value.| |00005280| 09 0d 6b 41 75 64 69 74 | 46 6f 72 6d 61 74 55 6e |..kAudit|FormatUn| |00005290| 73 69 67 6e 65 64 09 41 | 6e 20 75 6e 73 69 67 6e |signed.A|n unsign| |000052a0| 65 64 20 69 6e 74 65 67 | 65 72 20 6c 6f 6e 67 77 |ed integ|er longw| |000052b0| 6f 72 64 20 76 61 6c 75 | 65 2e 09 0d 6b 41 75 64 |ord valu|e...kAud| |000052c0| 69 74 46 6f 72 6d 61 74 | 48 65 78 09 41 6e 20 75 |itFormat|Hex.An u| |000052d0| 6e 73 69 67 6e 65 64 20 | 68 65 78 61 64 65 63 69 |nsigned |hexadeci| |000052e0| 6d 61 6c 20 76 61 6c 75 | 65 20 74 68 61 74 20 6d |mal valu|e that m| |000052f0| 61 79 20 62 65 20 69 6e | 74 65 72 70 72 65 74 65 |ay be in|terprete| |00005300| 64 20 61 73 20 61 20 34 | 2d 62 79 74 65 20 63 68 |d as a 4|-byte ch| |00005310| 61 72 61 63 74 65 72 2c | 20 73 75 63 68 20 61 73 |aracter,| such as| |00005320| 20 61 6e 20 4f 53 54 79 | 70 65 20 6f 72 20 52 65 | an OSTy|pe or Re| |00005330| 73 54 79 70 65 20 76 61 | 6c 75 65 2e 20 54 68 69 |sType va|lue. Thi| |00005340| 73 20 69 73 20 64 69 73 | 70 6c 61 79 65 64 20 62 |s is dis|played b| |00005350| 6f 74 68 20 69 6e 20 68 | 65 78 61 64 65 63 69 6d |oth in h|exadecim| |00005360| 61 6c 20 61 6e 64 20 61 | 73 20 61 20 63 68 61 72 |al and a|s a char| |00005370| 61 63 74 65 72 20 73 74 | 72 69 6e 67 20 28 77 69 |acter st|ring (wi| |00005380| 74 68 20 d4 2e d5 20 72 | 65 70 6c 61 63 69 6e 67 |th ... r|eplacing| |00005390| 20 61 6e 79 20 6e 6f 6e | 2d 70 72 69 6e 74 61 62 | any non|-printab| |000053a0| 6c 65 20 62 79 74 65 73 | 29 2e 09 0d 6b 41 75 64 |le bytes|)...kAud| |000053b0| 69 74 46 6f 72 6d 61 74 | 41 64 64 72 65 73 73 09 |itFormat|Address.| |000053c0| 41 6e 20 75 6e 73 69 67 | 6e 65 64 20 68 65 78 61 |An unsig|ned hexa| |000053d0| 64 65 63 69 6d 61 6c 20 | 76 61 6c 75 65 20 74 68 |decimal |value th| |000053e0| 61 74 20 69 73 20 6e 65 | 76 65 72 20 69 6e 74 65 |at is ne|ver inte| |000053f0| 72 70 72 65 74 65 64 20 | 61 73 20 61 20 63 68 61 |rpreted |as a cha| |00005400| 72 61 63 74 65 72 20 73 | 74 72 69 6e 67 2e 09 0d |racter s|tring...| |00005410| 6b 41 75 64 69 74 46 6f | 72 6d 61 74 45 6e 64 09 |kAuditFo|rmatEnd.| |00005420| 54 68 69 73 20 74 65 72 | 6d 69 6e 61 74 65 73 20 |This ter|minates | |00005430| 74 68 65 20 6c 69 73 74 | 20 6f 66 20 70 61 72 61 |the list| of para| |00005440| 6d 65 74 65 72 73 2e 20 | 54 68 65 20 41 75 64 69 |meters. |The Audi| |00005450| 74 46 6f 72 6d 61 74 31 | 2c 20 65 74 63 2e 20 6d |tFormat1|, etc. m| |00005460| 61 63 72 6f 73 20 61 70 | 70 65 6e 64 20 74 68 69 |acros ap|pend thi| |00005470| 73 20 61 73 20 6e 65 65 | 64 65 64 3a 20 62 79 20 |s as nee|ded: by | |00005480| 75 73 69 6e 67 20 74 68 | 65 73 65 20 6d 61 63 72 |using th|ese macr| |00005490| 6f 73 2c 20 79 6f 75 20 | 64 6f 20 6e 6f 74 20 6e |os, you |do not n| |000054a0| 65 65 64 20 74 6f 20 62 | 65 20 63 6f 6e 63 65 72 |eed to b|e concer| |000054b0| 6e 65 64 20 77 69 74 68 | 20 74 68 69 73 20 76 61 |ned with| this va| |000054c0| 6c 75 65 2e 09 0d 49 6e | 20 6f 72 64 65 72 20 74 |lue...In| order t| |000054d0| 6f 20 73 69 6d 70 6c 69 | 66 79 20 74 68 65 20 6c |o simpli|fy the l| |000054e0| 69 66 65 20 6f 66 20 74 | 68 65 20 70 6f 6f 72 20 |ife of t|he poor | |000054f0| 70 72 6f 67 72 61 6d 6d | 65 72 2c 20 74 68 65 20 |programm|er, the | |00005500| 68 65 61 64 65 72 20 66 | 69 6c 65 20 70 72 6f 76 |header f|ile prov| |00005510| 69 64 65 73 20 61 20 66 | 61 6d 69 6c 79 20 6f 66 |ides a f|amily of| |00005520| 20 6d 61 63 72 6f 73 20 | 74 68 61 74 20 61 6c 6c | macros |that all| |00005530| 6f 77 20 79 6f 75 20 74 | 6f 20 73 70 65 63 69 66 |ow you t|o specif| |00005540| 79 20 6f 6e 65 20 74 6f | 20 65 69 67 68 74 20 61 |y one to| eight a| |00005550| 72 67 75 6d 65 6e 74 73 | 2e 20 54 68 75 73 2c 20 |rguments|. Thus, | |00005560| 69 6e 73 74 65 61 64 20 | 6f 66 20 77 72 69 74 69 |instead |of writi| |00005570| 6e 67 0d 41 75 64 69 74 | 28 0d 09 61 75 64 69 74 |ng.Audit|(..audit| |00005580| 50 74 72 2c 0d 09 27 4d | 6f 6f 66 27 2c 0d 09 41 |Ptr,..'M|oof',..A| |00005590| 75 64 69 74 46 6f 72 6d | 61 74 28 0d 09 09 6b 41 |uditForm|at(...kA| |000055a0| 75 64 69 74 46 6f 72 6d | 61 74 53 69 67 6e 65 64 |uditForm|atSigned| |000055b0| 2c 09 6b 41 75 64 69 74 | 46 6f 72 6d 61 74 45 6e |,.kAudit|FormatEn| |000055c0| 64 2c 09 6b 41 75 64 69 | 74 46 6f 72 6d 61 74 45 |d,.kAudi|tFormatE| |000055d0| 6e 64 2c 09 6b 41 75 64 | 69 74 46 6f 72 6d 61 74 |nd,.kAud|itFormat| |000055e0| 45 6e 64 2c 0d 09 09 6b | 41 75 64 69 74 46 6f 72 |End,...k|AuditFor| |000055f0| 6d 61 74 45 6e 64 2c 09 | 09 6b 41 75 64 69 74 46 |matEnd,.|.kAuditF| |00005600| 6f 72 6d 61 74 45 6e 64 | 2c 09 6b 41 75 64 69 74 |ormatEnd|,.kAudit| |00005610| 46 6f 72 6d 61 74 45 6e | 64 2c 09 6b 41 75 64 69 |FormatEn|d,.kAudi| |00005620| 74 46 6f 72 6d 61 74 45 | 6e 64 29 2c 0d 09 28 6c |tFormatE|nd),..(l| |00005630| 6f 6e 67 29 20 31 32 33 | 34 35 0d 29 3b 0d 79 6f |ong) 123|45.);.yo| |00005640| 75 20 63 61 6e 20 77 72 | 69 74 65 0d 09 41 75 64 |u can wr|ite..Aud| |00005650| 69 74 28 61 75 64 69 74 | 50 74 72 2c 20 27 4d 6f |it(audit|Ptr, 'Mo| |00005660| 6f 66 27 2c 20 41 75 64 | 69 74 46 6f 72 6d 61 74 |of', Aud|itFormat| |00005670| 31 28 6b 41 75 64 69 74 | 46 6f 72 6d 61 74 53 69 |1(kAudit|FormatSi| |00005680| 67 6e 65 64 29 2c 20 28 | 6c 6f 6e 67 29 20 31 32 |gned), (|long) 12| |00005690| 33 34 35 29 3b 0d 4e 6f | 74 65 20 74 68 61 74 20 |345);.No|te that | |000056a0| 74 68 65 20 66 75 6e 63 | 74 69 6f 6e 20 63 61 6c |the func|tion cal| |000056b0| 6c 20 65 78 70 6c 69 63 | 69 74 6c 79 20 63 61 73 |l explic|itly cas| |000056c0| 74 73 20 74 68 65 20 69 | 6e 74 65 67 65 72 20 70 |ts the i|nteger p| |000056d0| 61 72 61 6d 65 74 65 72 | 20 74 6f 20 6c 6f 6e 67 |arameter| to long| |000056e0| 2e 0d 54 68 65 20 68 65 | 61 64 65 72 20 66 69 6c |..The he|ader fil| |000056f0| 65 20 70 72 6f 76 69 64 | 65 73 20 41 75 64 69 74 |e provid|es Audit| |00005700| 46 6f 72 6d 61 74 31 2c | 20 41 75 64 69 74 46 6f |Format1,| AuditFo| |00005710| 72 6d 61 74 32 2c 20 c9 | 2c 20 41 75 64 69 74 46 |rmat2, .|, AuditF| |00005720| 6f 72 6d 61 74 38 20 6d | 61 63 72 6f 73 2e 20 0d |ormat8 m|acros. .| |00005730| 57 72 69 74 69 6e 67 20 | 61 20 53 74 72 69 6e 67 |Writing |a String| |00005740| 20 74 6f 20 74 68 65 20 | 41 75 64 69 74 20 52 65 | to the |Audit Re| |00005750| 63 6f 72 64 0d 76 6f 69 | 64 0d 41 75 64 69 74 53 |cord.voi|d.AuditS| |00005760| 74 72 69 6e 67 28 0d 09 | 41 75 64 69 74 50 74 72 |tring(..|AuditPtr| |00005770| 09 61 75 64 69 74 50 74 | 72 2c 0d 09 4f 53 54 79 |.auditPt|r,..OSTy| |00005780| 70 65 09 69 64 43 6f 64 | 65 2c 0d 09 63 6f 6e 73 |pe.idCod|e,..cons| |00005790| 74 20 53 74 72 69 6e 67 | 50 74 72 09 73 74 72 69 |t String|Ptr.stri| |000057a0| 6e 67 0d 29 3b 0d 54 68 | 65 20 41 75 64 69 74 53 |ng.);.Th|e AuditS| |000057b0| 74 72 69 6e 67 20 66 75 | 6e 63 74 69 6f 6e 20 73 |tring fu|nction s| |000057c0| 74 6f 72 65 73 20 61 20 | 73 74 72 69 6e 67 20 69 |tores a |string i| |000057d0| 6e 20 61 20 73 69 6e 67 | 6c 65 20 41 75 64 69 74 |n a sing|le Audit| |000057e0| 20 72 65 63 6f 72 64 20 | 65 6e 74 72 79 2e 20 49 | record |entry. I| |000057f0| 74 20 69 73 20 61 63 74 | 75 61 6c 6c 79 20 69 6d |t is act|ually im| |00005800| 70 6c 65 6d 65 6e 74 65 | 64 20 61 73 20 61 20 6d |plemente|d as a m| |00005810| 61 63 72 6f 20 61 73 20 | 66 6f 6c 6c 6f 77 73 3a |acro as |follows:| |00005820| 0d 23 64 65 66 69 6e 65 | 20 41 75 64 69 74 53 74 |.#define| AuditSt| |00005830| 72 69 6e 67 28 61 75 64 | 69 74 50 74 72 2c 20 69 |ring(aud|itPtr, i| |00005840| 64 43 6f 64 65 2c 20 73 | 74 72 69 6e 67 29 20 28 |dCode, s|tring) (| |00005850| 09 09 09 09 09 5c 0d 09 | 09 41 75 64 69 74 28 09 |.....\..|.Audit(.| |00005860| 09 09 09 09 09 09 09 09 | 09 09 09 09 09 09 5c 0d |........|......\.| |00005870| 09 09 09 28 61 75 64 69 | 74 50 74 72 29 2c 09 09 |...(audi|tPtr),..| |00005880| 09 09 09 09 09 09 09 09 | 09 09 5c 0d 09 09 09 28 |........|..\....(| |00005890| 69 64 43 6f 64 65 29 2c | 09 09 09 09 09 09 09 09 |idCode),|........| |000058a0| 09 09 09 09 09 5c 0d 09 | 09 09 41 75 64 69 74 46 |.....\..|..AuditF| |000058b0| 6f 72 6d 61 74 31 28 6b | 41 75 64 69 74 46 6f 72 |ormat1(k|AuditFor| |000058c0| 6d 61 74 53 74 72 69 6e | 67 29 2c 09 09 09 09 09 |matStrin|g),.....| |000058d0| 09 5c 0d 09 09 09 73 74 | 72 69 6e 67 09 09 09 09 |.\....st|ring....| |000058e0| 09 09 09 09 09 09 09 09 | 09 09 5c 0d 09 09 29 09 |........|..\...).| |000058f0| 09 09 09 09 09 09 09 09 | 09 09 09 09 09 09 09 5c |........|.......\| |00005900| 0d 09 29 0d 57 72 69 74 | 69 6e 67 20 61 20 53 74 |..).Writ|ing a St| |00005910| 61 74 75 73 20 45 72 72 | 6f 72 20 74 6f 20 74 68 |atus Err|or to th| |00005920| 65 20 41 75 64 69 74 20 | 52 65 63 6f 72 64 0d 76 |e Audit |Record.v| |00005930| 6f 69 64 0d 41 75 64 69 | 74 53 74 61 74 75 73 53 |oid.Audi|tStatusS| |00005940| 74 72 69 6e 67 28 0d 09 | 41 75 64 69 74 50 74 72 |tring(..|AuditPtr| |00005950| 09 61 75 64 69 74 50 74 | 72 2c 0d 09 4f 53 54 79 |.auditPt|r,..OSTy| |00005960| 70 65 09 69 64 43 6f 64 | 65 2c 0d 09 4f 53 45 72 |pe.idCod|e,..OSEr| |00005970| 72 09 73 74 61 74 75 73 | 2c 0d 09 63 6f 6e 73 74 |r.status|,..const| |00005980| 20 53 74 72 69 6e 67 50 | 74 72 09 73 74 72 69 6e | StringP|tr.strin| |00005990| 67 0d 29 3b 0d 54 68 65 | 20 41 75 64 69 74 53 74 |g.);.The| AuditSt| |000059a0| 61 74 75 73 53 74 72 69 | 6e 67 20 66 75 6e 63 74 |atusStri|ng funct| |000059b0| 69 6f 6e 20 73 74 6f 72 | 65 73 20 61 6e 20 6f 70 |ion stor|es an op| |000059c0| 65 72 61 74 69 6e 67 2d | 73 79 73 74 65 6d 20 73 |erating-|system s| |000059d0| 74 61 74 75 73 20 63 6f | 64 65 20 61 6e 64 20 61 |tatus co|de and a| |000059e0| 63 63 6f 6d 70 61 6e 69 | 6e 67 20 64 65 73 63 72 |ccompani|ng descr| |000059f0| 69 70 74 69 76 65 20 73 | 74 72 69 6e 67 20 69 6e |iptive s|tring in| |00005a00| 20 61 20 73 69 6e 67 6c | 65 20 41 75 64 69 74 20 | a singl|e Audit | |00005a10| 72 65 63 6f 72 64 20 65 | 6e 74 72 79 2e 20 0d 76 |record e|ntry. .v| |00005a20| 6f 69 64 0d 41 75 64 69 | 74 53 74 61 74 75 73 4c |oid.Audi|tStatusL| |00005a30| 6f 63 61 74 69 6f 6e 28 | 0d 09 41 75 64 69 74 50 |ocation(|..AuditP| |00005a40| 74 72 09 61 75 64 69 74 | 50 74 72 2c 0d 09 4f 53 |tr.audit|Ptr,..OS| |00005a50| 54 79 70 65 09 69 64 43 | 6f 64 65 2c 0d 09 4f 53 |Type.idC|ode,..OS| |00005a60| 45 72 72 09 73 74 61 74 | 75 73 0d 29 3b 0d 54 68 |Err.stat|us.);.Th| |00005a70| 65 20 41 75 64 69 74 53 | 74 61 74 75 73 4c 6f 63 |e AuditS|tatusLoc| |00005a80| 61 74 69 6f 6e 20 66 75 | 6e 63 74 69 6f 6e 20 73 |ation fu|nction s| |00005a90| 74 6f 72 65 73 20 61 6e | 20 6f 70 65 72 61 74 69 |tores an| operati| |00005aa0| 6e 67 2d 73 79 73 74 65 | 6d 20 73 74 61 74 75 73 |ng-syste|m status| |00005ab0| 20 63 6f 64 65 20 61 6e | 64 20 74 68 65 20 6c 6f | code an|d the lo| |00005ac0| 63 61 74 69 6f 6e 20 6f | 66 20 74 68 65 20 63 61 |cation o|f the ca| |00005ad0| 6c 6c 20 69 6e 20 61 20 | 73 69 6e 67 6c 65 20 41 |ll in a |single A| |00005ae0| 75 64 69 74 20 72 65 63 | 6f 72 64 20 65 6e 74 72 |udit rec|ord entr| |00005af0| 79 2e 20 54 68 65 20 6c | 6f 63 61 74 69 6f 6e 20 |y. The l|ocation | |00005b00| 75 73 65 73 20 74 68 65 | 20 4d 61 63 73 42 75 67 |uses the| MacsBug| |00005b10| 20 6e 61 6d 65 20 61 6e | 64 20 69 73 20 73 69 6d | name an|d is sim| |00005b20| 69 6c 61 72 20 74 6f 20 | 74 68 65 20 73 74 72 69 |ilar to |the stri| |00005b30| 6e 67 20 74 68 61 74 20 | 77 6f 75 6c 64 20 62 65 |ng that |would be| |00005b40| 20 64 69 73 70 6c 61 79 | 65 64 20 62 79 20 74 68 | display|ed by th| |00005b50| 65 20 4d 61 63 73 42 75 | 67 20 d4 73 63 36 d5 20 |e MacsBu|g .sc6. | |00005b60| 63 6f 6d 6d 61 6e 64 2e | 0d 42 6f 74 68 20 41 75 |command.|.Both Au| |00005b70| 64 69 74 53 74 61 74 75 | 73 53 74 72 69 6e 67 20 |ditStatu|sString | |00005b80| 61 6e 64 20 41 75 64 69 | 74 53 74 61 74 75 73 4c |and Audi|tStatusL| |00005b90| 6f 63 61 74 69 6f 6e 20 | 61 72 65 20 69 6d 70 6c |ocation |are impl| |00005ba0| 65 6d 65 6e 74 65 64 20 | 61 73 20 6d 61 63 72 6f |emented |as macro| |00005bb0| 73 20 74 68 61 74 20 63 | 61 6c 6c 20 41 75 64 69 |s that c|all Audi| |00005bc0| 74 20 77 69 74 68 20 74 | 68 65 20 70 72 6f 70 65 |t with t|he prope| |00005bd0| 72 20 66 6f 72 6d 61 74 | 20 65 78 70 72 65 73 73 |r format| express| |00005be0| 69 6f 6e 2e 20 0d 52 65 | 61 64 69 6e 67 20 61 6e |ion. .Re|ading an| |00005bf0| 20 41 75 64 69 74 20 52 | 65 63 6f 72 64 20 45 6e | Audit R|ecord En| |00005c00| 74 72 79 0d 42 6f 6f 6c | 65 61 6e 0d 52 65 61 64 |try.Bool|ean.Read| |00005c10| 41 75 64 69 74 28 0d 09 | 41 75 64 69 74 50 74 72 |Audit(..|AuditPtr| |00005c20| 09 61 75 64 69 74 50 74 | 72 2c 0d 09 41 75 64 69 |.auditPt|r,..Audi| |00005c30| 74 45 6e 74 72 79 50 74 | 72 09 74 68 69 73 4c 6f |tEntryPt|r.thisLo| |00005c40| 67 45 6e 74 72 79 0d 29 | 3b 0d 49 66 20 74 68 65 |gEntry.)|;.If the| |00005c50| 72 65 20 69 73 20 61 6e | 20 61 75 64 69 74 20 72 |re is an| audit r| |00005c60| 65 63 6f 72 64 20 65 6e | 74 72 79 20 77 61 69 74 |ecord en|try wait| |00005c70| 69 6e 67 20 66 6f 72 20 | 74 68 69 73 20 61 75 64 |ing for |this aud| |00005c80| 69 74 20 72 65 63 6f 72 | 64 2c 20 52 65 61 64 41 |it recor|d, ReadA| |00005c90| 75 64 69 74 20 63 6f 70 | 69 65 73 20 69 74 20 74 |udit cop|ies it t| |00005ca0| 6f 20 79 6f 75 72 20 65 | 6e 74 72 79 20 62 75 66 |o your e|ntry buf| |00005cb0| 66 65 72 20 61 6e 64 20 | 72 65 74 75 72 6e 73 20 |fer and |returns | |00005cc0| 54 52 55 45 2e 20 49 66 | 20 6e 6f 74 68 69 6e 67 |TRUE. If| nothing| |00005cd0| 20 69 73 20 77 61 69 74 | 69 6e 67 20 28 6f 72 20 | is wait|ing (or | |00005ce0| 61 75 64 69 74 50 74 72 | 20 69 73 20 4e 55 4c 4c |auditPtr| is NULL| |00005cf0| 29 2c 20 69 74 20 72 65 | 74 75 72 6e 73 20 46 41 |), it re|turns FA| |00005d00| 4c 53 45 2e 20 4e 6f 74 | 65 20 74 68 61 74 20 52 |LSE. Not|e that R| |00005d10| 65 61 64 41 75 64 69 74 | 20 64 6f 65 73 20 6e 6f |eadAudit| does no| |00005d20| 74 20 63 61 72 65 20 77 | 68 65 74 68 65 72 20 61 |t care w|hether a| |00005d30| 75 64 69 74 20 6c 6f 67 | 67 69 6e 67 20 69 73 20 |udit log|ging is | |00005d40| 63 75 72 72 65 6e 74 6c | 79 20 65 6e 61 62 6c 65 |currentl|y enable| |00005d50| 64 2e 0d 49 66 20 52 65 | 61 64 41 75 64 69 74 20 |d..If Re|adAudit | |00005d60| 72 65 74 75 72 6e 73 20 | 46 41 4c 53 45 2c 20 6e |returns |FALSE, n| |00005d70| 6f 20 61 64 64 69 74 69 | 6f 6e 61 6c 20 64 61 74 |o additi|onal dat| |00005d80| 61 20 69 73 20 72 65 74 | 75 72 6e 65 64 2e 0d 52 |a is ret|urned..R| |00005d90| 65 61 64 41 75 64 69 74 | 20 63 6f 70 69 65 73 20 |eadAudit| copies | |00005da0| 69 74 73 20 69 6e 74 65 | 72 6e 61 6c 20 61 75 64 |its inte|rnal aud| |00005db0| 69 74 20 65 6e 74 72 79 | 20 74 6f 20 74 68 65 20 |it entry| to the | |00005dc0| 62 75 66 66 65 72 20 74 | 68 61 74 20 79 6f 75 72 |buffer t|hat your| |00005dd0| 20 70 72 6f 67 72 61 6d | 20 73 70 65 63 69 66 69 | program| specifi| |00005de0| 65 73 2e 20 54 68 65 6e | 20 69 74 20 69 6d 6d 65 |es. Then| it imme| |00005df0| 64 69 61 74 65 6c 79 20 | 72 65 74 75 72 6e 73 20 |diately |returns | |00005e00| 74 68 65 20 62 75 66 66 | 65 72 20 74 6f 20 74 68 |the buff|er to th| |00005e10| 65 20 66 72 65 65 20 62 | 75 66 66 65 72 20 6c 69 |e free b|uffer li| |00005e20| 73 74 20 2e 20 41 20 73 | 75 62 73 65 71 75 65 6e |st . A s|ubsequen| |00005e30| 74 20 73 65 63 74 69 6f | 6e 20 6f 66 20 74 68 69 |t sectio|n of thi| |00005e40| 73 20 64 6f 63 75 6d 65 | 6e 74 20 64 65 73 63 72 |s docume|nt descr| |00005e50| 69 62 65 73 20 74 68 65 | 20 63 6f 6e 74 65 6e 74 |ibes the| content| |00005e60| 20 6f 66 20 61 6e 20 41 | 75 64 69 74 45 6e 74 72 | of an A|uditEntr| |00005e70| 79 20 72 65 63 6f 72 64 | 2e 20 0d 46 6f 72 6d 61 |y record|. .Forma| |00005e80| 74 74 69 6e 67 20 74 68 | 65 20 41 75 64 69 74 20 |tting th|e Audit | |00005e90| 52 65 63 6f 72 64 20 45 | 6e 74 72 79 20 44 61 74 |Record E|ntry Dat| |00005ea0| 61 0d 76 6f 69 64 0d 46 | 6f 72 6d 61 74 41 75 64 |a.void.F|ormatAud| |00005eb0| 69 74 45 6e 74 72 79 44 | 61 74 61 28 0d 09 41 75 |itEntryD|ata(..Au| |00005ec0| 64 69 74 45 6e 74 72 79 | 50 74 72 09 65 6e 74 72 |ditEntry|Ptr.entr| |00005ed0| 79 50 74 72 2c 0d 09 53 | 74 72 69 6e 67 50 74 72 |yPtr,..S|tringPtr| |00005ee0| 09 72 65 73 75 6c 74 0d | 29 3b 0d 46 6f 72 6d 61 |.result.|);.Forma| |00005ef0| 74 41 75 64 69 74 45 6e | 74 72 79 44 61 74 61 20 |tAuditEn|tryData | |00005f00| 63 6f 6e 76 65 72 74 73 | 20 74 68 65 20 64 61 74 |converts| the dat| |00005f10| 61 20 69 6e 20 74 68 65 | 20 65 6e 74 72 79 20 74 |a in the| entry t| |00005f20| 6f 20 61 20 72 65 61 64 | 61 62 6c 65 20 73 74 72 |o a read|able str| |00005f30| 69 6e 67 2c 20 73 74 6f | 72 69 6e 67 20 74 68 65 |ing, sto|ring the| |00005f40| 20 66 6f 72 6d 61 74 74 | 65 64 20 6f 75 74 70 75 | formatt|ed outpu| |00005f50| 74 20 69 6e 20 74 68 65 | 20 72 65 73 75 6c 74 20 |t in the| result | |00005f60| 73 74 72 69 6e 67 2e 20 | 49 74 20 64 6f 65 73 20 |string. |It does | |00005f70| 6e 6f 74 20 64 69 73 70 | 6c 61 79 20 74 68 65 20 |not disp|lay the | |00005f80| 64 61 74 61 2c 20 6e 6f | 72 20 64 6f 65 73 20 69 |data, no|r does i| |00005f90| 74 20 63 6f 6e 76 65 72 | 74 20 74 68 65 20 74 69 |t conver|t the ti| |00005fa0| 6d 65 73 74 61 6d 70 2e | 20 54 68 65 20 46 6f 72 |mestamp.| The For| |00005fb0| 6d 61 74 41 75 64 69 74 | 45 6e 74 72 79 44 61 74 |matAudit|EntryDat| |00005fc0| 61 20 66 75 6e 63 74 69 | 6f 6e 20 20 69 73 20 70 |a functi|on is p| |00005fd0| 72 6f 76 69 64 65 64 20 | 69 6e 20 41 75 64 69 74 |rovided |in Audit| |00005fe0| 45 6e 74 72 79 46 6f 72 | 6d 61 74 2e 63 2e 20 49 |EntryFor|mat.c. I| |00005ff0| 74 20 6d 61 79 20 6e 65 | 65 64 20 74 6f 20 62 65 |t may ne|ed to be| |00006000| 20 6d 6f 66 69 66 69 65 | 64 20 66 6f 72 20 6e 6f | mofifie|d for no| |00006010| 6e 2d 45 6e 67 6c 69 73 | 68 20 75 73 61 67 65 2e |n-Englis|h usage.| |00006020| 0d 46 6f 72 6d 61 74 74 | 69 6e 67 20 74 68 65 20 |.Formatt|ing the | |00006030| 41 75 64 69 74 20 52 65 | 63 6f 72 64 20 45 6e 74 |Audit Re|cord Ent| |00006040| 72 79 20 54 69 6d 65 73 | 74 61 6d 70 0d 76 6f 69 |ry Times|tamp.voi| |00006050| 64 0d 46 6f 72 6d 61 74 | 41 75 64 69 74 45 6e 74 |d.Format|AuditEnt| |00006060| 72 79 54 69 6d 65 73 74 | 61 6d 70 28 0d 09 41 75 |ryTimest|amp(..Au| |00006070| 64 69 74 50 74 72 09 61 | 75 64 69 74 50 74 72 2c |ditPtr.a|uditPtr,| |00006080| 0d 09 41 75 64 69 74 45 | 6e 74 72 79 50 74 72 09 |..AuditE|ntryPtr.| |00006090| 65 6e 74 72 79 50 74 72 | 2c 0d 09 53 74 72 69 6e |entryPtr|,..Strin| |000060a0| 67 50 74 72 09 72 65 73 | 75 6c 74 0d 29 3b 0d 46 |gPtr.res|ult.);.F| |000060b0| 6f 72 6d 61 74 41 75 64 | 69 74 45 6e 74 72 79 54 |ormatAud|itEntryT| |000060c0| 69 6d 65 73 74 61 6d 70 | 20 63 6f 6e 76 65 72 74 |imestamp| convert| |000060d0| 73 20 74 68 65 20 65 6e | 74 72 79 d5 73 20 74 69 |s the en|try.s ti| |000060e0| 6d 65 73 74 61 6d 70 20 | 74 6f 20 61 20 72 65 61 |mestamp |to a rea| |000060f0| 64 61 62 6c 65 20 73 74 | 72 69 6e 67 2c 20 73 74 |dable st|ring, st| |00006100| 6f 72 69 6e 67 20 74 68 | 65 20 66 6f 72 6d 61 74 |oring th|e format| |00006110| 74 65 64 20 6f 75 74 70 | 75 74 20 69 6e 20 72 65 |ted outp|ut in re| |00006120| 73 75 6c 74 2e 20 54 68 | 65 20 6f 75 74 70 75 74 |sult. Th|e output| |00006130| 20 69 73 20 61 20 66 69 | 78 65 64 2d 6c 65 6e 67 | is a fi|xed-leng| |00006140| 74 68 20 73 74 72 69 6e | 67 20 77 69 74 68 20 74 |th strin|g with t| |00006150| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 20 66 6f 72 |he follo|wing for| |00006160| 6d 61 74 3a 0d 31 39 39 | 32 2e 31 32 2e 32 35 20 |mat:.199|2.12.25 | |00006170| 32 32 3a 31 30 3a 34 34 | 2e 31 32 33 0d 54 68 65 |22:10:44|.123.The| |00006180| 20 72 65 73 75 6c 74 20 | 63 6f 6e 74 61 69 6e 73 | result |contains| |00006190| 20 74 68 65 20 79 65 61 | 72 2c 20 6d 6f 6e 74 68 | the yea|r, month| |000061a0| 2c 20 61 6e 64 20 64 61 | 74 65 20 28 69 6e 20 49 |, and da|te (in I| |000061b0| 53 4f 2d 64 61 74 65 20 | 66 6f 72 6d 61 74 29 2c |SO-date |format),| |000061c0| 20 66 6f 6c 6c 6f 77 65 | 64 20 62 79 20 74 68 65 | followe|d by the| |000061d0| 20 74 69 6d 65 20 6f 66 | 20 64 61 79 20 69 6e 20 | time of| day in | |000061e0| 32 34 2d 68 6f 75 72 20 | 63 6c 6f 63 6b 20 66 6f |24-hour |clock fo| |000061f0| 72 6d 61 74 20 77 69 74 | 68 20 74 68 65 20 72 65 |rmat wit|h the re| |00006200| 73 69 64 75 61 6c 20 63 | 6c 6f 63 6b 20 74 69 63 |sidual c|lock tic| |00006210| 6b 73 20 28 69 6e 20 6d | 69 6c 6c 69 73 65 63 6f |ks (in m|illiseco| |00006220| 6e 64 73 29 2e 20 54 68 | 69 73 20 66 6f 72 6d 61 |nds). Th|is forma| |00006230| 74 20 69 73 20 69 6e 64 | 65 70 65 6e 64 65 6e 74 |t is ind|ependent| |00006240| 20 6f 66 20 74 68 65 20 | 74 69 6d 65 20 61 6e 64 | of the |time and| |00006250| 20 64 61 74 65 20 66 6f | 72 6d 61 74 74 69 6e 67 | date fo|rmatting| |00006260| 20 73 65 6c 65 63 74 65 | 64 20 62 79 20 74 68 65 | selecte|d by the| |00006270| 20 63 6f 6d 70 75 74 65 | 72 20 75 73 65 72 2e 20 | compute|r user. | |00006280| 54 68 65 20 46 6f 72 6d | 61 74 41 75 64 69 74 45 |The Form|atAuditE| |00006290| 6e 74 72 79 54 69 6d 65 | 73 74 61 6d 70 20 66 75 |ntryTime|stamp fu| |000062a0| 6e 63 74 69 6f 6e 20 20 | 69 73 20 70 72 6f 76 69 |nction |is provi| |000062b0| 64 65 64 20 69 6e 20 41 | 75 64 69 74 45 6e 74 72 |ded in A|uditEntr| |000062c0| 79 46 6f 72 6d 61 74 2e | 63 2e 20 0d 53 75 70 70 |yFormat.|c. .Supp| |000062d0| 6f 72 74 20 46 75 6e 63 | 74 69 6f 6e 73 0d 59 6f |ort Func|tions.Yo| |000062e0| 75 72 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 20 73 |ur appli|cation s| |000062f0| 68 6f 75 6c 64 20 75 73 | 65 20 74 68 65 20 66 6f |hould us|e the fo| |00006300| 6c 6c 6f 77 69 6e 67 20 | 66 75 6e 63 74 69 6f 6e |llowing |function| |00006310| 73 20 74 6f 20 61 63 63 | 65 73 73 20 61 6e 20 61 |s to acc|ess an a| |00006320| 75 64 69 74 20 72 65 63 | 6f 72 64 d5 73 20 69 6e |udit rec|ord.s in| |00006330| 74 65 72 6e 61 6c 20 73 | 74 72 75 63 74 75 72 65 |ternal s|tructure| |00006340| 2e 20 54 68 65 79 20 61 | 6c 73 6f 20 6d 61 6b 65 |. They a|lso make| |00006350| 20 69 74 20 70 6f 73 73 | 69 62 6c 65 20 74 6f 20 | it poss|ible to | |00006360| 65 78 74 65 6e 64 20 74 | 68 65 20 6c 69 62 72 61 |extend t|he libra| |00006370| 72 79 20 77 69 74 68 6f | 75 74 20 72 65 71 75 69 |ry witho|ut requi| |00006380| 72 69 6e 67 20 63 68 61 | 6e 67 65 73 20 69 6e 20 |ring cha|nges in | |00006390| 61 6e 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 20 70 |an appli|cation p| |000063a0| 72 6f 67 72 61 6d 2e 20 | 41 6c 6c 20 61 75 64 69 |rogram. |All audi| |000063b0| 74 20 72 65 63 6f 72 64 | 20 73 74 72 75 63 74 75 |t record| structu| |000063c0| 72 65 20 65 6c 65 6d 65 | 6e 74 73 20 6d 75 73 74 |re eleme|nts must| |000063d0| 20 62 65 20 61 63 63 65 | 73 73 65 64 20 74 68 72 | be acce|ssed thr| |000063e0| 6f 75 67 68 20 74 68 65 | 73 65 20 66 75 6e 63 74 |ough the|se funct| |000063f0| 69 6f 6e 73 20 61 73 20 | 74 68 65 79 20 70 72 65 |ions as |they pre| +--------+-------------------------+-------------------------+--------+--------+ Only 25.0 KB of data is shown above.